I do like the idea of reloadNode retrieving the latest details for parent and child nodes and not just children since it would give a means of updating other columns in the parent node but if you do decide to implement it then it would require some keyword in the URL request so that the server could distinguish the request from a normal expandNode URL
.
I look forward to your decision
MymsMan
Changing the isLeaf property of the parent node to false allows you to expand/collapse the node but doesn’t change the icon to an arrow.
Perhaps the simplest solution would be to add a setLeaf(true/false) method that would change both the property and icon at the same time.
MymsMan
Alas not 🙁
It fails with the exact same error message and location!
In case it makes a difference I am using the Adjacency tree model
I will see if I can reproduce with a simpler grid.
MymsMan
The beforeSearch/afterSearch to switch between local/json is working very nicely, thank you
.
I am still getting errors with searching after filtering.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
TypeError: obj is undefined line 292 js/jquery.jqGrid.js?1.2.8-3 getAccessor : function(obj, expr) { var ret,p,prm = [], i; if( typeof expr === 'function') { return expr(obj); } ===> ret = obj[expr]; if(ret===undefined) { try { if ( typeof expr === 'string' ) { prm = expr.split('.'); } i = prm.length; if( i ) { ret = obj; while (ret && i--) { p = prm.shift(); ret = ret[p]; } } } catch (e) {} } return ret; }, |
.
Unrelated to these problems I notice that with the GitHub version for columns where I have specified ‘clearSearch: false’ the right hand side of the filter input field is missing but it is present with 5.0.2
MymsMan
see the Group column headers demo in the Functionality section.
I am not sure if this is what you were thinking about
MymsMan
Thank you,
You can’t have your cake and eat it is an old English proverb.
In this case you have demonstrated that the seemingly impossible is actually quite simple to achieve 🙂
.
I will see if I can recreate my sort problems when using the correct setup,
MymsMan
Thank you for implementing this however I am having some problems getting it to work which may be due to my unfamiliarity with installing code from GitHub!
.
I downloaded the zip file from github and copied js/jquery.jqGrid.min.js and js/grid.treegrid.js to my server and included them in my web page. Is that correct/ sufficient?
.
When I attempted to search I noticed that rather than the local search which I was expecting (since treegrid switches to local after loading) it sent a search request to the server
1 2 3 4 |
_search true filters {"groupOp":"AND","rules":[{"field":"autodecrypt","op":"eq","data":"1"}]} |
.
It appears to be because I had loadonce: false which is needed for incremental tree load, when I switched to loadonce:true local search started to work but of course I lost the benefits of incremental loading.
.
Is it possible to have my cake and eat it? I would like to have both incremental load and local search but with the limitation that search can only find data in the nodes that have already been loaded.
.
Whilst the new code seems to work well most of the time it does fail on some occasions and I have yet to spot any pattern in the failures. I have a number of columns that contain 0 or 1, filtering for 1 nearly always works whilst filtering for 0 sometimes works but other times it either returns no results or all rows.
I will continue to look for a reproducible test case,
.
I also noticed a problem sorting a tree grid After it has been filtered
1 2 3 |
TypeError: a is undefined ...if("function"==typeof b)return b(a);if(c=a<strong class="d4pbbc-bold"></strong>,void 0===c)try{if("string"==typeof... |
Sorting before filtering is OK and Sorting a non-tree grid is OK when filtered
MymsMan
I had the same problem and was advised on these forums to use the beforeRowSelect event which works well without the need for double clicking
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
beforeSelectRow : function( rowid, event) { if($(event.target).is(":checkbox")) { if($(event.target).is(":checked")) { console.log("Row " + rowid + " checkbox selected") } else { console.log("Row " + rowid + " checkbox deselected") } return false; } return true; }, |
The return false prevents the row from being selected by the checkbox click.
<p>
Of course it would be much better if there were a specific event driven for checkbox select and it was fully explained in the documentation
MymsMan
MymsMan:
I’ve been a customer of their php suite for the past three years or so and I have had the exact same complaint as you regarding their documentation, and I’ve been getting the same promise, that “we know it’s out of date/incomplete and we will have it fixed/updated very soon”.
At this point I doubt that they will ever have decent documentation.
Poor documentation damages Gurrido as much as it annoys customers.
They have to spend time on these forums explaining what should be obvious from the documentation and if it is not obvious that the product supports a function people will look for alternative products.
There is no point building a better mousetrap if no can find it or understand how to use it!
MymsMan
I am also interested in the same,
I would also like to be able to filter on a value range e.g. age between 20 and 30
MymsMan
I solved my problem by creating a jqGrid extension to calculate the width of visible columns.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// Extend jqGrid with resetGridWidth function // Set grid width to total width of visible columns $.jgrid.extend({resetGridWidth(){ var gid = this.selector; var colmod=$(this).jqGrid('getGridParam','colModel'); var w=0 for (i=0;i<colmod.length;i++) { name=colmod[ i ].name; if (!colmod[ i ].hidden) { // console.log("resetGridWidth " + name); w += $(gid+"_"+name).outerWidth(); } } $(this).jqGrid('setGridWidth',w); // console.log("resetGridWidth " +w); return w; }}); |
I think it would be helpful if a similar function was added to the product to save other user from having to re-invent this wheel
MymsMan
Even if the code was in the correct order it would have no effect since p.width is not updated by the showCol/ hideCol calls issued earlier in columnChooser.
<p>Either columnChooser should calculate the required grid width prior to calling .done or jqGrid should supply a method to calculate the total width of visible columns.
MymsMan
Thanks, that works well
MymsMan
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top