Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Stan on Apr 30, 2007 16:27
open dhtmlx forum
dhtmlxGrid

I am experimenting with the grid. Many functions accept either rowID or rowIndex.
What is the difference between the two?
Also it seems that it is possible to add rows with duplicate ID or Index, the grid does not report an error in this case.
Another questions that comes to mind is that when doing a lot of adding/deleting rows it is very hard to manually generate rowIDs. Also you may end up with unused rowIDs (when deleting). Is there a facility which would automatically provide the next available rowId when adding a new Row?

Thak you,
Stan.
Answer posted on May 05, 2007 15:12

>>What is the difference between the two?


Row index - zero based number of row, counted from the top
Cell index - zero based number of column, counted from the left

Row id - each row must have unique ID, by which it can be identified
Cell id - each column can have unique ID (optional) by which it can be
identified.


Indexes allow to operate with elements placed at specific position
IDs allow to operate with element without relation to its position


>>Also it seems that it is possible to add rows with duplicate ID or Index, the grid does not report an error in this case.

The grid doesn't report problem of duplicate ID, but it will may cause different incorrect behaviours.


>>Another questions that comes to mind is that when doing a lot of adding/deleting rows it is very hard to manually generate rowIDs

Basically the row ID is just unique_number, you can use any unique values for them, most samples use timestamp as ID ( as it is can be used as relative stable unique number )
     grid.addRow((new Date()).valueOf(),...
In case of linking grid to DB through DataProcessor - it will automatically change item ID to real one after saving new row in DB.


Answer posted by Andrei (Support) on Dec 11, 2014 14:42

If you haven't found the needed information there and still looking for a solution, you will find the additional help checking popup date picker javascript and ajax javascript.