Forum
00:10
21/11/2008
Hi,
I am tyring to setup a grid with data manipulation on the client using a local array. Any help with the following will be appreciated, as i don't seem to get it working or find any examples of the same.
1. Stop refresh/restore of the changed data on clicking on sort
2. Save changed data to local array
3. editRow does not seem to mark dirty cells as do inline editing of single cells using cellEdit: true
4. What is the structure of the return from getChangedCells('all');
Thank you,
Suresh
02:50
Moderators
30/10/2007
Hello,
1. What you mean with stop/refresh when sort. Data is sorted according
to the rules of sorting. If you do not wnant to sort, then you can
disable this.
2. Use the following methods - getDataIDs and getRowData methods
for this purpose.
3. Yes this is true. Will be supported in next releases.
4. As described in the documentation:
"Returns an array of the changed cells depending on method (string, default 'all'). When 'all' this method returns all the changed rows; when 'dirty' returns only the changed cells with the id of the row"
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
14:18
21/11/2008
Hi Tony,
Thank you for the response. Let me clarify below on my issues
1. I would like to sort my data. However if i edit my data in the cell, i would like to retain the new data in my grid. Clicking on the column heading refreshes the data back to the original data and then sorts the data causing loss of my changed data
2. Will try the methods. thanks
3. ok
4. The description of the array is not clear to me. An example will help. Is the array structure a name value pair like [row_id, field_name, value].
Thank you once again,
Suresh
11:41
Moderators
30/10/2007
Hello,
1. It is very natural that the data must be saved first and then perform the sort. otherwiese what you recommend to do? Also this is a idea to add a event beforeSortCol - if this event return true we can sort otherwiese no. This will solve meybe your problem.
4. The array structure is:
result = [ {id:rowid1, name1:value11....},
{id:rowid2, name1:value21....},
...
]
where the name is the name from colModel
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
13:33
21/11/2008
Hi,
Thanks again for the prompt response.
1. I was thinking there is a temporary object which stores the data in the grid along with changed data. That would allow sorting without saving the data.
I will use your suggestion on using eventbeforeSortCol to disable sorting upon edit.
2. I tried the getRowData method, but i don't seem to get any data back. Is there a working example posted anywhere in the demos?
3. Thanks. Will use it.
Glad to be using your widget,
Suresh
06:42
Moderators
30/10/2007
Hello,
Before trying getRowData you should use getDataIDs - something like this
var rids = $("#mygrid").getDataIDs(); // this give you all ids in grid
for(var i=0;i<rids.length;i++) {
var currentrow = $("#mygrid").getRowData(rids[i]);
// here your code to appent currentrow in array
}
Hope this helps
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
03:28
Moderators
30/10/2007
Hello,
Do you mean grid as subgrid or pure subgrid? If you are in second case there are no methods to acces data from subgrid.If you are in first case this should work for the subgrid.
Best Regads
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
18:50
21/11/2008
Hi Tony,
Thanks. I was able to retrieve the data from subgrid as well. However, there seems to be an issue upon edit where the cell value within the subgrid is being set to the html text (e.g getRowData gives me <input class=editable id=2_Pos style=”width:99%” value=8 jQueryxx='249' > where it should have only given me 8
I noticed the same behaviour when i close the subgrid. The subgrid gets represented as a row with html code.
/Suresh
04:30
Moderators
30/10/2007
Hello,
To be a clear. getRowData does not work correct when the row is edited, since of the additionlly added contend. To obtain the data for edited row you should use the combination of the rowid and name from colmodel something like:
if you edit the row with id 2 then
jQuery("2_myname").val();
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
12:39
21/11/2008
Hi Tony,
Thank you, that explains how to get the data from edited row. I guess i will have to embed the logic to check for dirty cells and then make the appropriate call. Also, I guess this is the cause for the subgrid to be displayed as code upon edit...Seems like i will need some display logic here as well.
Thanks for the help and Wish you all a very happy new year 2009.
happy holidays,
Suresh
Most Users Ever Online: 715
Currently Online:
56 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66