0

Anyone know how to add in jqgrid in each row a data-attributes and values that are get of the url-request?

I have different id's to stored in each line and after I open the subgrid I have to query this attributes again. I use subgrid and need this id's for the subgrid.

I can not find Docu, which describes how I can get any values from json string and how I can add to the row's, such as data-tag and how to query these values again when the subgrid is opened.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
selfmade
  • 91
  • 4
  • `afterInsertRow` is wrong way. look at [the answer] which shows how to use `data-xxx` attributes and `rowattr` instead. It can be that you don't need to save any data in `data` attribute at all and use just `userData` for example instead (see [the answer](http://stackoverflow.com/a/14205263/315935)). You should post more details about what you need to implement. – Oleg Feb 11 '15 at 19:07
  • sorry...i will check your link, that looks like good. i take it a other way... but i think this way is stupid. loadComplete : function(data) { data.rows.forEach( function ( row, i ) { var z = i + 1; jQuery(grid_selector).find('tr').eq(z).attr('data-group', row['data-group']); }); }, – selfmade Feb 12 '15 at 23:52
  • i get the groupid in row['data-group'] and add with this function in loadcomplete to every row in my grid, after that, if i expand this row to my subgrid i fetch the groupid with subGridRowExpanded: function (subgridDivId, rowId) { var dataGroup = $("#"+rowId).data('group');..................... but this is a stupid way to do this... i get a lot of any id's and would safe this in my rows like data-attribute=myid . i will check your links, i see, that looks like good and axactly what i looking for ... the rowattr. thanks so far best regards achim – selfmade Feb 12 '15 at 23:53
  • Sorry, one link from my previous comment seems be broken: [this one](http://stackoverflow.com/a/18313154/315935). – Oleg Feb 13 '15 at 09:18

0 Answers0