0

How do I get that object name circled in red (see image). I've already tried this and it didn't work: https://stackoverflow.com/a/10314492/3112803

Details: I have a DHTMLX grid where cells in a certain column can be a different type per row (either a checkbox or an image). From what I can tell their API gives you a way to SET different types, example: mygrid.setCellExcellType(rowId,colIdx,"img"); but they don't have a function for GETTING the types. http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:api_toc_alpha I need to determine what type the cell is (and I don't want to do it via looking at the innerHTML). Look at the attached image from Chrome console. Those are the objects in the cells. If I can somehow grab what is circled in red then I could determine the type. I don't know how to grab that name.

enter image description here

UPDATE: Still not solved. Another forum on this same issue: http://forum.dhtmlx.com/viewtopic.php?f=2&t=34217&start=0

Community
  • 1
  • 1
gfrobenius
  • 3,987
  • 8
  • 34
  • 66
  • 1
    Based on your post here and at forum.dhtmlx.com I assume you set/change the `GridCellType` via `JavaScript`, right? Wouldn't it be possible to store all changes you made in an 2D array? You could initialize it the moment you create your grid an update it every time you change the `GridCellType` in you grid, too. – endofsource Feb 04 '14 at 17:28
  • Yes, you are correct. It would be possible, thanks for the suggestion, I may do that. DHTMLX replied back in their forum saying there is no `getCellExcellType()` type of function so I'll either do your suggestion or just keep my try/catch in place. When I try to do a checkbox action on an image (that used to be a checkbox) it fails, so the try/catch works fine. I just hate using them as work arounds. I'd rather do `if(getCellExcellType()==='ch') ...do checkbox stuff...`, but oh well. – gfrobenius Feb 04 '14 at 22:40
  • You could outsource you try-catch code into a seperate function like `isCellCheckBox(rowId, cellId)` and use it like this: `if (isChellCheckBox(42,13)) ... do checkbox stuff...`. If you then change you implementation to the way I suggested you just need to change that one function (: – endofsource Feb 05 '14 at 09:19

1 Answers1

1

Uhmmmm, in the API there's a function called getColType(cInd).

mygrid.getColType(8) ---> returns i.e. "price"

GRID API

user2844810
  • 985
  • 7
  • 11
  • My types are different per row in the same column. So I need to get the type per cell (a given rowId,colIdx). – gfrobenius Jan 28 '14 at 22:44