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
Hello,
Such kind of description of the problem will not help you.
In order to get quality support you will need to prepare a working test case.
You can publish it here, send it to support team or prepare online version.
Please note the phrase – working test case
Kind Regards,
Will
Guriddo Support Team
Hello Ken,
Thank you for the feedback and glad to hear that it works as expected
Kind Regards,
Will
Guriddo Support Team
Hello Ken,
I think you missed my first post that when once created the pivot grid does not make any request to the php file.
I will explain it in detail.
In your case, when you include for the first time the file leaderboard.php in the index file it creates the pivot definitions and the grid is constructed without data. After it is created it send request ONLY ONCE to get all the needed data.
When data comes to grid it is transformed and there are NO MORE REQUESTS to leaderboard.php file. The grid is now in local mode. This can be easy seen if you try to sort, do a paging and etc – no requests to the server.
Because of this in order to do search, local build should be done like in our demo. No PHP code – only JavaScript code.
Kind Regards,
Will
Guriddo Support Team
Hello,
As far as I understand you missed to bind a click to search button and use the function which we provide in our demo.
Include our function from the example in your index.php and bind a click as we do in our code. You will need just to configure the input data to meet your requirements.
|
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 40 41 42 43 44 45 46 47 48 |
/** * Build custom search string from array of objects * @param {Array} rule_arr the array where the data and rules are * @param {String} group group logical operator of the fields * @returns {String} */ function buildCustomSearch( rule_arr, group ){ if(group === undefined) { group = "AND"; } var ruleGroup = ""; if(Array.isArray(rule_arr) && rule_arr.length) { ruleGroup = "{\"groupOp\":\"" + group + "\",\"rules\":["; var gi=0; $.each(rule_arr,function(i,n){ if (gi > 0) {ruleGroup += ",";} ruleGroup += "{\"field\":\"" + n.name + "\","; ruleGroup += "\"op\":\"" + n.oper + "\","; ruleGroup += "\"data\":\"" + n.val.replace(/\\/g,'\\\\').replace(/\"/g,'\\"') + "\"}"; gi++; }); ruleGroup += "]}"; } return ruleGroup; } var grid = $("#jqGrid"); // rplace with your id $("#do_search").on('click',function(){ var my_fld=[]; /* *opts : ['eq','ne', 'lt', 'le', 'gt', 'ge', 'nu', 'nn', 'in', 'ni','bw', 'bn', 'ew', 'en', 'cn', 'nc'], */ /* my_fld.push({ name: "OrderDate", val : $("#from_date").val(), oper:"ge" }); my_fld.push({ name: "OrderDate", val : $("#to_date").val(), oper:"le" }); */ // configure my_fld in a way above to meet your needs var rule = buildCustomSearch( my_fld, "AND"); grid.setGridParam({postData:{filters:rule}, search:true}).trigger("reloadGrid"); }); |
Regards,
Will
Guriddo Support Team
Hello Ken,
Please check this demo example
If you have questions or something is not clear, please let us know.
Kind Regards,
Will
Guriddo Support Team
Hello Ken,
Yes this is possible.
You need to know that after the pivot grid is build, it stay in local mode and no request to server is possible.
In order to achieve this it is needed to build the filters string manually and pass it to postData which should do the job.
In the next days we will post a example how to do this. We think it will be useful to have such method.
Kind Regards,
Will
Guriddo Support Team
Hello Kris,
First of all we apologize that for some reason we have missed this post.
You can do this using the addLocalData method with true parameter
|
1 2 |
var grid = $("#grid")[0]; var filtered_data = grid.addLocalData( true ); |
Kind Regards,
Will
Guriddo Support Team
Hello Ken,
Just do some test with your table.
I apologize really for that, that I miss some important setting in the script.
Our original script work like champ if you add only one important setting
|
1 2 3 |
... $grid->getLastInsert = true; ... |
This option enables getting the lastInserId from the table.
By default it is fale.
We have tested with this setting and it work.
Sorry again for my mistake on this setting.
Kind Regards,
Will
Guriddo Support Team
Hello Ken,
Thank you for the update.
Actually we use the PDO lastInserId
I’m very curious if this script will work:
Replace
|
1 2 3 |
$sql = "select LAST_INSERT_ID()"; $stmt = $conn->query($sql); $lastInsertID = $stmt->fetch(); |
with
|
1 2 3 |
.... $lastInsertID = $conn->lastInsertId(); ... |
where $conn is the connection object.
and disable the transactions before do the insert
|
1 2 3 |
... $grid2->trans= false; ... |
I think that maybe the problem was in the transaction set to true.
Regards,
Will
Guriddo Support Team
Hello Ken
Would be possible to send us the table definition of tblLandOwners?
I mean the create table script.
Thank you.
Kind Regards
Will
Guriddo Support Team
Hello Kris,
Thank you very much for the suggestions.
return_fld can be a function See here
About the select – we do not have tested it on select, but I will see what we can do and will replay ASAP.
Thank you again for the suggestion.
Kind Regards,
Will
Guriddo Support Team
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top