What I have implemented is:
1 2 3 4 5 6 7 8 9 10 11 |
colMenu: true, colMenuColumnDone: function(cols,column,checked) { console.log("colMenuColumnDone "+column+" checked: "+checked); if (column!="") { if (checked) { $(this).jqGrid("showCol",column).jqGrid("resizeGrid",500,true,false); } else { $(this).jqGrid("hideCol",column).jqGrid("resizeGrid",500,true,false); } } }, |
MymsMan
I would like to resize the grid to maintain the table as 100% of window width when columns are hidden/shown so my first thought was to call resizegrid from the colMenuColumnDone function but this will not work correctly if the event is triggered before the column visibility changes.
Is there an alternative/better way of achieving what I want
The colMenuColumnDone is called when the column is shown/hide in column menu, but it is called before the show/hide column
MymsMan
I went back to a previous project and found I had used
1 2 3 |
$("#recordingsGrid").jqGrid("clearGridData") .jqGrid('setGridParam', { datatype: "xmlstring", datastr: recordList }) .trigger('reloadGrid', [{ current:true}]); |
So I have solved my problem but I am still wondering why addXmlData was not found
MymsMan
Thank you for reply, I do appreciate the time you spend in responding to all my questions and will try out the styling.
You already have the colmodel attribute viewable: to control whether or not an element is included in the view panel so for passwords etc these can easily be set to viewable: false there should be no need for another colmodel attribute to control whether the field is actually viewable
MymsMan
OK I will look into custom formatter – No chance to modify source (xmltv)
MymsMan
Thank you
That provides a usable work around the problem
MymsMan
nb Using jqGrid 5.5.5
MymsMan
That seems to fix the problem. 🙂
.
I’ll let you know if I spot any other problems
MymsMan
I have emailed the code
MymsMan
The fix solves my problem of expanding/collapsing nodes that I initially reported but does not solve the secondary problem that i reported yesterday.
.
In the onselect_demo after loadstate in the select handler the contents of the isLeaf, expanded, uiicon properties appear to have been interchanged.
MymsMan
My environment is quite complex and difficult to extract a usable sample – the server runs on a video recorder!
When retrying my previous sample based onselect_event demo file I don’t get the same error but selecting a leaf node after loadState does not display the price and icon because isLeaf in rdata is not a boolean value
1 2 3 4 5 6 |
isLeaf "ui-icon-tag" expanded "true" |
MymsMan
Apologies for not replying sooner – been working on a different project.
.
Unfortunately the new code is not working for me
1 2 3 4 5 |
jquery.jqGrid.js?1.2.8-13:11422 Uncaught TypeError: Cannot read property 'isLeaf' of undefined (anonymous function) @ jquery.jqGrid.js?1.2.8-13:11422 n.event.dispatch @ jquery.js?1.2.8-13:3 r.handle @ jquery.js?1.2.8-13:3 |
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
if(ret.treeGrid) { var i = 1, len = grid[0].rows.length, expCol = ret.expColInd, isLeaf = ret.treeReader.leaf_field, expanded = ret.treeReader.expanded_field; // optimization of code needed here while(i<len) { $(grid[0].rows<em class="d4pbbc-italic"></em>.cells[expCol]) .find("div.treeclick") .bind("click",function(e){ var target = e.target || e.srcElement, ind2 =$.jgrid.stripPref(ret.idPrefix,$(target,grid[0].rows).closest("tr.jqgrow")[0].id), pos = ret._index[ind2]; if(!ret.data[pos][isLeaf]){ if(ret.data[pos][expanded]){ grid.jqGrid("collapseRow",ret.data[pos]); grid.jqGrid("collapseNode",ret.data[pos]); } else { grid.jqGrid("expandRow",ret.data[pos]); grid.jqGrid("expandNode",ret.data[pos]); } } return false; }); |
MymsMan
OK – I will wait for news
MymsMan
Working well now, 🙂
.
Thank you for quick response
MymsMan
I have downloaded the master.zip from github and installed the updated js and cleared cache but get an error message with{searchOperators: true,
–
1 2 3 4 5 6 7 8 |
TypeError: this.searchoptions is undefined this.searchoptions.searchOperMenu = true; jquery....1.2.8-9 (line 7721, col 8) if(p.searchOperators) { if(soptions.searchOperMenu == null) { this.searchoptions.searchOperMenu = true; } so = (soptions.sopt) ? soptions.sopt[0] : cm.stype==='select' ? 'eq' : p.defaultSearch; |
.
No error if I specify {searchOperators: false
MymsMan
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top