Hi,
I use scrollrows:true and setSelected, but the grid does not scroll dynamically (the row is correctly selected). My code is :
|
1 |
jQuery(document).ready(function(){<br /> var initialLoad = true;<br /> jQuery("#listSociete").jqGrid({ <br /> <strong>scrollrows : true, </strong><br /> url:'getValues.php?type=contentSociete',<br /> datatype: "json",<br /> colNames:['Nom','Secteur d\'Activité', 'Progiciel', 'Commercial'],<br /> colModel:[<br /> {name:'Nom',index:'Nom', align:"left", sortable:true, search: true},<br /> {name:'NomSecteur',index:'NomSecteur', sortable:true, search: true},<br /> {name:'NomOutil',index:'NomOutil', sortable:true, search: true}<br /> ,{name:'NomCommercial',index:'NomCommercial', sortable:true, search: true}<br /> ],<br /> hidegrid: false,<br /> hiddengrid: false,<br /> loadui:'block',<br /> loadtext:"Chargement...",<br /> pager: jQuery('#pagerSociete'),<br /> pgbuttons:false,<br /> pginput:false,<br /> viewrecords:true,<br /> sortname: 'Nom',<br /> sortorder: "asc",<br /> caption: "Sociétes",<br /> forceFit: true,<br /> loadonce: false,<br /> width: 1000,<br /> onSelectRow: function(rowid) { <br /> // Memorisation de la societe selectionnee<br /> memoriseVariable('societeSelected', rowid); // Puts id in a COOKIE<br /> },<br /> loadComplete: function() {<br /> // Selection de la ste memorisee<br /> if (initialLoad && recupereVariable('societeSelected')) // If first lload and cookie is set<br /> <strong>jQuery("#listSociete").setSelection(recupereVariable('societeSelected'), true); </strong> <br /> initialLoad = false;<br /> }<br /> }); <br /> |
Sorry, my mistake : I'm trying to reproduce
Hi,
Not sure to understand your need. Did you add the “cellEdit: true” option ? the URL specified in the “cellurl” parameter should then be called : the name of the modified field + the rowid are POSTed to this page.
Thanks Tony, I saw this option but never managed to make it work.
In fact I found that the value to specify should be the displayed value and not the real “value”, the example in the documentation is not clear enought :
editoptions:{value:'Yes:Yes;No:No'}, defval:'Yes'
It would be more clear with something like that :
editoptions:{value:'1:Yes;0:No'}, defval:'Yes'
Now it's ok for me 🙂
Hi Tony,
Thanks a lot, it seems OK ! Great work.
Regards.
Hi Tony,
I suppose my explanation was not so clear… And by the way I made some more tests.
I use the Autoload. When I sort a column, the ajax request is : page 1, x rows, and the new specified sort order.
But in fact, the already loaded data is not cleared form the grid and the new result is added. For exemple, I have a total of 6 records (a, b, c, d, e, f) and my grid shows 3 rows (a, b, c). Then I click on my column to sort in reverse order. I then have a, b, c (the previous rows), f, e, d (the first page of my new request) in ly grid.
But I also found while testing that sometimes, it works (the grid is correctly emptied). It seems to vary depending on the data (column value empty or not ?). I made a test with 3 basic columns (text content, sometimes empty) and I can't find any rule… But with these 3 columns (more simple data than the code in my first post) it works nearly all the time.
I hope my exmplanation are not too “ugly”…
Thanks for tour time
Hi Tony,
Could you tell us if this case will be solved in the 3.5 release ? I still have it with the build 10.
Thanks
Hello again,
Forget my question : its an error in my PHP script…
Thanks
Hello,
I'm trying to integrate my pages containing jqGrid tables in UI/Tabs.
I use the ajax loading for each tab. In the first tab tables are displayed correctly, but on other pages, tables are not correctly displayed.
In fact, with Firebug I can see that data is present in the tables but all is white (text, borders, etc.). I can only see table title and everything else is invisible. Moreover, it's not only a color problem : mouse pointer is not modified when moving over what should be headers, columns, etc. But when in “inspect” mod on firebig, I can see the elements location highlighted.
Any idea on the cause of this ? Did you find anything concerning tonromeyn problem ?
Finally I found the problem : I added a “scroll:true” parameter in my grids (while testing 3.4 beta) and didn't removed it.
Without this parameter (or at “false”), the results are correctly displaying.
I use the filterGrid method. For example :
jQuery(”#t_listCandidat”).height(25).filterGrid(”listCandidat”,{gridModel:true,gridToolbar:true,gridNames:true,enableClear:false});
When filters are initialized on page load via JS, and the the triggerSearch method is run, the search works fine :
$('#contentCandidat').find('#”.$key.”').val('”.$val.”');
jQuery(“#listCandidat”).setGridParam({datatype: 'json'});
var cs = jQuery('#t_listCandidat')[0];
cs.triggerSearch();
Unfortunaletly no : its on an intranet whith no access from outside…
What could I provide to you ? The PHP code of page displaying a table ?
Hi,
I needed this functionality too. What I did is that I added a “print” button in the toolbar.
Then with jQuery, I clone jqGrid table in a new window (a bit dirty to find the table, but It works, even if you have multiple tables on your page) :
// Parent container of the “list” DIV (In my case, I have a DIV includind all elements of a jqGrid table)
var idMasterDiv = $('#'+gridName).parent().parent().attr('id');
// Find jqGrid table to print
$('div[id^=”jqgh”]').each ( function() {
I would also appreciate this functionnality 🙂
Thanks for all.
Thanks a lot !! It does the job !
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top