Get row id
I am trying to look through the source code but having a hard time finding where I need to be.
I am using php and each row that is pulled has an 'id'.
When the row in the grid is clicked i want to be able to do something with that id.
What file do I need to look in? Thanks
Newbie
November 23,
i think you're talking about Grid.getSelectionProperty("index")
dmb
November 23,
I m looking for the same Plz help...
Grid.getSelectionProperty("index") method is quite OK to use. but I am looking
at a way to assign the unique ids of recordset in a table to the indices of rows in grid.
Plz give the code to do so...
I have posted for it many times but didn't got any satified results :(
Ritesh Jagga
November 24,
Maintain a local mapping for the unique ids to the recordset indices and refer the same to retrive the ids. This is more of a tactical issue than something that you are claiming as missing feature. By the way, what is your data Model? XML (Node/HTTP) or plain Array based?
Md. Sheriff, Drivestream
November 24,
Sheriff, Thanks for your kind suggestion...
Hope this solution may help others.....
I have found the solution to the problem.
There is no need to assign the unque ids of recordsets in ur dbase table to the rows in the grid.
This has been a problem with many of the people using Activewidgets.
There is a very simple solution:
1. Make a column for the ids retrieved from the data model(whatever it may be): XML, MySql , JS Array or any other
in the same manner as ids are also part of data to be shown in the grid.
2. Hide the id column using method
(Grid.setColumnIndices([1,2,3...]));//Remember 0 has been omitted, it represents 1st column.
3.Retrieve the id on the keypress/keydown event of delete key, I hv used click event so change it.
obj.onRowClicked = function(event, index)
{
//Get the contents of cell with Column index '0' and RowIndex 'index'.
var id = obj.getCellValue(0, index);
//alert(id);
loadGridAfterDelete(id);//Function to be called inorder to delete the data of particular id retrieved
}
Note: the example is for Grid V2.0 b2
Deleted, There is nothing more. U can use the same method to add/edit also.
Cheers.......:)
Ritesh Jagga
November 25,
omitting 0 does not work in v2.0b3
0 seems to be the first colomn of data you load.
giant
December 7,
obj.onRoweClicked = function(event, index){
alert(this.getRowPosition(index));
}
this will give the index of row clicked
Shoaib
June 15,
How can i search the already created grid
Mayank Shrivastava
August 17,