Hello,
Thank you for clarification.
One possible solution that I see is to define your own navGrid with buttons of your desire
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$.jgrid.extend({ myNavGrid : function(/*navgrid params here*/){ return this.each(function() { $(this).jqGrid('navGrid',.......); $(this).jqGrid('navButtonAdd',...); /*here other actions*/ }); } }); // then replace navGrid with myNavGrid $("#grid").jqGrid('myNavGrid'...); |
Another possible solution is to add event in navGrid which will be executed every time after the navGrid is called. We will see what we can do for this.
Kind Regards,
WIll
Guriddo Support Team
Hello,
Thank you for posting your question. I’m not sure that I correctly understand the question.
If you speak how to create jqGrid method you can see one of the modules and simple follow this approach. Actually you will need to extend the jqgrid object. Bellow is approach on how the method FormToGrid is created:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$.jgrid.extend({ FormToGrid : function(rowid, formid, mode, position){ return this.each(function() { var $t = this; if(!$t.grid) {return;} if(!mode) {mode = 'set';} if(!position) {position = 'first';} var fields = $(formid).serializeArray(); var griddata = {}; $.each(fields, function(i, field){ griddata[field.name] = field.value; }); if(mode==='add') {$($t).jqGrid("addRowData",rowid,griddata, position);} else if(mode==='set') {$($t).jqGrid("setRowData",rowid,griddata);} }); } }); |
and then call it to the grid with id- grid
1 |
$("#grid").jqGrid('FormToGrid,...); |
If something is not clear, please let us know we will try to explain it
Kind Regards,
Will
Guriddo Support Team
Hello,
As you write a message to the support e-mail and you have already a solution, could you please post it here so that we can help other people having similar problems.
Thank you
Kind Regards,
Will
Guriddo Support Team
Hello,
can you please give us more information for the problem? Can you please post your grid setup? What is not working?
Thank you.
Kind Regards
Will
Guriddo Support Team
Hello,
You can use rowattr event for this purpose.
Below Example:
1 2 3 4 5 6 7 8 9 10 11 |
$('#grid').jqGrid({ ... rowattr : function( rowData ) { if( rowData.myfield === 'A') { return { "class": 'ui-state-disabled' }; } else { return {}; } }, ... }); |
Kind Regards
Will
Guriddo Support Team
Hello,
If I correctly understand the requirement, you need you add a disabled class to this row, it will be not selected either with user input and when you click SelectAll.
If you use jQuery UI css the class is named ui-state-disabled
If You use Bootstrap 3,4,5 the class is named ui-disabled
Kind Regards,
Will
Guriddo Support Team
Hello,
Trirand.net and Guriddo are two different things. The only common is the jqGrd JavaScript library, but nothing more.
Unfortunately we do not have any information for trirand.net about its current status. It seems it stooped working.
What we can offer you is to upgrade to the latest jqGrid JavaScript lib according to the rules as you are existing licensed user of Guriddo jqGrid JS – i.e with 50% discount, but not upgrade to the DLL lib.
If this is ok for you, please write e-mail to: sales at guriddo dot net.
Kind Regards,
Will
Guriddo Support Team
Hello,
This is your example with our modifications.
Click on the PHP tab to see the code.
Kind Regards,
Will
Guriddo Support Team
Ken,
Our sql is different from your original. Please check it carefully.
I’m going to prepare a online example and will publish it.
Our idea is to send codes in the response and not the names.
Do this like in your code you will need to change your setSelect to select only the names and not the id. (if you want your search to work)
Please set debug to true and see what is happen.
Kind Regards,
Will
Guriddo Support Team
Hello,
Thank you for the update. Now it is imported successfully.
I have used your script and with the following changes it is working as per your requirement:
1 2 3 4 5 6 7 8 9 10 11 12 |
$grid->SelectCommand = " select m.ID, m.CustomerFullName, m.Status from tblMain m, tblCustomers c, tblStatus s where m.CustomerFullName = c.CustomerFullNameID and m.Status = s.StatusID"; ... $grid->setSelect("CustomerFullName","SELECT CustomerFullNameID, CustomerFullName from tblCustomers order by 2", true, true, true, array(""=>"")); $grid->setSelect("Status","SELECT StatusID, Status from tblStatus order by 2", true, true, true, array(""=>"")); |
We have tested it and the searching is working.
Kind Regards,
Will
Guriddo Support Team
Hello,
I want to check what you have posted, but when I try to insert the sql in the phpmyadmin I have errors.
Can you please check what you have posted for the SQL script.
The best test is to create temporary database and try to import the sql in it.
Kind Regards,
Will
Guriddo Support Team
Hello,
At first look this to work is needed to modify your SQL like this
1 2 3 4 5 6 7 8 9 |
$grid->SelectCommand = " select m.ID, c.CustomerFullNameID, s.StatusID from tblMain m, tblCustomers c, tblStatus s where m.CustomerFullName = c.CustomerFullNameID and m.Status = s.StatusID"; |
And activate the formatter option in setSelect
1 2 |
$grid->setSelect("CustomerFullName","SELECT CustomerFullNameID, CustomerFullName from tblCustomers order by 2", true, true, true, array(""=>"")); $grid->setSelect("Status","SELECT StatusID, Status from tblStatus order by 2", true, true, true, array(""=>"")); |
This way you can use the normal select for search on index.
Kind Regards,
Will
Guriddo Support Team
Hello,
We apologize for this. This is due to the recent changes in WordPress and the plugins used.
For now you can mark Paste as Text and then select the pasted code and use code from Format menu.
We will try to find better syntax highlighter.
Thank you for attention on this problem.
Kind Regards,
Will
Guriddo Support Team
Hello,
If I correctly undersatnd the requierment you can try with this CSS setting.
1 2 3 4 5 |
.ui-state-highlight > .jqgrid-rownum{color: white !important} |
Kind Regards,
Will
Guriddo Support Team
Hello,
Thank you for the test case. It is much easier to solve this way the problem.
The problem appear in subGridBeforeExpandRow which triggers a click which actually forces the expandGridRow (Catch 22)
To solve the problem use the following trick:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
$("#grid").jqGrid({ datatype: 'local', data: myGridData, colNames: ['id','Column 1', 'Column 2'], colModel: [ { name: 'id', hidden: true, key: true}, { name: 'col1', width: 200 }, { name: 'col2', width: 200 } ], subGrid: true, height: 400, subGridBeforeExpand: function(pID, id) { if(last_expanded_row_id !== undefined) { setTimeout(function() { $("#grid").collapseSubGridRow(last_expanded_row_id); }, 50); } }, subGridRowExpanded: function (pID, id) { var childGridID = pID + "_table"; var childGridPagerID = pID + "_pager"; $('#' + pID).append('<table id=' + childGridID + '></table><div id=' + childGridPagerID + ' class=scroll></div>'); $("#" + childGridID).jqGrid({ datatype: 'local', data: mySubgrids[id], colNames: ['Col 1', 'Col 2', 'Col 3'], colModel: [ { name: 'c1', width: 100 }, { name: 'c2', width: 100 }, { name: 'c3', width: 100 } ], gridComplete : function() { setTimeout(function() { last_expanded_row_id = id;},1000); } }); } }); |
Guriddo Support Team
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top