Hello,
Thank you for remind us to test the changes in all popular browsers.
I have fixed the problem. You can get the code from github. Also I have updated your demo too.
Please let us know if the problem is fixed.
Kind Regards,
Hello,
Sorry that we do not post our final decision here.
Actually what is TypeScript?
As per definition : TypeScript is a superset of JavaScript, that compiles to plain JavaScript
Actually when we have a TypScript code we compile it to JavaScript again, so the final result is the same.
We have made a long discussion and have made a decision to stop for now writing TypeScript code for jqGrid. This will cost us too much (note that we are small company).
If we begin to write jqGrid from the beginning we will definitely use TypeScript, but to do the inverse to have the same as we have – it will cost us too much.
Hope I express myself clear.
For now we stop with this and I can not commit to any ceratain date when we will have TypeScript jqGrid
Kind Regards,
Hello,
No. Most of operations like retrieving data, sorting, paging, searching are performed at PHP end. The build of grid is based and some descriptions of the php script and the script generates automatically the java script code.
For clarification in master grid we use onselectRow, onPaging, onSortCol events,
The javascript for onSelectRow is:
|
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 |
onSelectRow : function(rowid, selected) { if(rowid != null) { jQuery("#detail").jqGrid('setGridParam',{postData:{EmployeeID:rowid}}); jQuery("#detail").jqGrid('setColProp','EmployeeID',{editoptions:{defaultValue:rowid}}); jQuery("#detail").trigger("reloadGrid"); // Enable CRUD buttons in navigator when a row is selected jQuery("#add_detail").removeClass("ui-state-disabled"); jQuery("#edit_detail").removeClass("ui-state-disabled"); jQuery("#del_detail").removeClass("ui-state-disabled"); } }, onPaging : function(rowid, selected) { // clear the grid data and footer data jQuery("#detail").jqGrid('clearGridData',true); // Disable CRUD buttons in navigator when a row is not selected jQuery("#add_detail").addClass("ui-state-disabled"); jQuery("#edit_detail").addClass("ui-state-disabled"); jQuery("#del_detail").addClass("ui-state-disabled"); }, onSortCol : function(rowid, selected) { // clear the grid data and footer data jQuery("#detail").jqGrid('clearGridData',true); // Disable CRUD buttons in navigator when a row is not selected jQuery("#add_detail").addClass("ui-state-disabled"); jQuery("#edit_detail").addClass("ui-state-disabled"); jQuery("#del_detail").addClass("ui-state-disabled"); }, .... |
In the detail grid we use beforShowForm for adding and recreateForm : true for add and edit.
These options should be set in navigator add, edit events
The code for beforeShowForm is:
|
1 2 3 4 5 6 7 8 9 10 |
beforeShowForm : function(formid) { var srow = jQuery("#grid").jqGrid('getGridParam','selrow'); if(srow) { var gridrow = jQuery("#grid").jqGrid('getRowData',srow); $("#EmployeeID",formid).val(gridrow.EmployeeID); } } |
Kind Regards,
Hello,
If you use html5 definition in your page you can do this without any additional plugin.
You will need to set in the field in colModel
|
1 2 3 4 5 6 7 8 9 |
... colModel : [ ..., {name : 'spinner',...,editoptions : { type: 'number', min: 1, max :1000 },..} ..., ], ... |
I have tested this definition in Bootstrap and it works fine for me.
Kind Regards,
Hello,
Thank you for the feedback.
Kind Regards,
Hello,
Thank you for getting back to us.
As I every time explain – it is very difficult to reproduce the client problem.
From my point of view jqGrid work correct, since we have similar example which work fine. See it here
Please understand that if you want help resolving the problem, you should post a code which demonstrates the problem – otherwise we can nothing to do.
Kind Regards,
Hello,
This is strange. Do you have clear the browser cache? Sometimes this help.
I have re created your example, which uses the code from GitHub.
Here is the link to your demo
It seems it is fixed here.
Kind Regards
Hello,
I have fixed the problem here.
You can download the code from GitHub and test it. See my previous instructions how to use the code from GitHub.
The code needs to be optimized, but I will do this when the bug fix will be published.
Please let us know if the problem is fixed for you.
Thank you.
Kind Regards,
Hello,
By the way which version of jqGrid is used? It seems it is old, since you use
GridUnload instead of $.jgrid.gridUnload.
The below code works for me
|
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 |
function GridSearchText() { //$.jgrid.gridUnload('Tracking'); var text = 3;//$('#txttext').val().trim(); //my text to be searched $("#Tracking").jqGrid({ datatype: 'json', prmNames: { search: "isSearch", nd: null, rows: "numRows", page: "page", sort: "sortField", order: "sortOrder" }, url : "myddata.json", postData: { PO_txt: text }, autowidth: true, height: "500px", colNames: ["ID", "Title", "Desc"], colModel: [ { name: "ID", align: 'center', width: "1500px" }, { name: "Title", align: 'center', width: "2000px", sortable: false }, { name: "Desc", align: 'center', width: "1500px", sortable: false }, ], jsonReader: { root: "d.rows", page: "d.page", total: "d.total", records: "d.records", cell: "cell", id: "ID", //index of the column with the PK in it userdata: "userdata", repeatitems: true }, shrinktofit: true, rowNum: 3, rowList: [3, 6], pager: '#TrackingPager', sortname: "Title", sortorder: "asc", viewrecords: true, gridview: true,datatype: 'json', autoencode: true, loadonce: true, pgtext: "Page {0} of {1}", loadtext: "Searching Text …!!!" }); $("#Tracking").jqGrid('gridResize', '#TrackingPager'); } |
The response is like this
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
{"d":{ "total":2, "page":1, "records":6, "rows": [{"ID":"1","Title":"1","Desc":"one"}, {"ID":"2","Title":"2","Desc":"two"}, {"ID":"3","Title":"3","Desc":"three"}, {"ID":"4","Title":"4","Desc":"four"}, {"ID":"5","Title":"5","Desc":"five"}, {"ID":"6","Title":"6","Desc":"six"} ]} } |
P.S. You use eval in your code in addJSONData. The using of eval is not recommended – you may use the build in JSON.parse
Kind Regards,
Hello,
Thank you for posting the solution.
If possible, please explain why is this needed.
Thank you
Kind Regards,
Hello,
The nutshell of the problem is the using of addRowData. This method does not take in account the pagination – it take in account the count of the records only.
There is more than one possible solution.
like this:
First you should not use datatype as function, but just a regular jqGrid. Add in your grid options this
|
1 2 |
jsonReader: { root: "d.rows", page: "d.page", total: "d.total", records: "d.records" }; |
Kind Regards,
Hello Kris,
Thank you for the question.
You are right – jQuery Mobile seems to be dead project. There is nothing on it about a year in GitHub.
As you can see we have made the first step – Bootstrap support. It is not too much, but it is a beginning.
Our plans are to reconsider our Mobile jqGrid to another base – I mean Bootstrap or other, but we should carefully do this, since we have a bad experience with jQuery Mobile.
Currently we make our plans on what we will do to the end of year and one of this is the Mobile jqGrid version. We will let you know or you may want look recently on our Roadmap
Kind Regards,
Hello,
Currently I do not find a appropriate solution for this. Let me try another approach.
Will let you know ASAP.
Thank you
Kind Regards,
Hello,
If this work as expected it is ok to get the variable this way.
Maybe Your ajax which get unitest2 does not have async = false. Try to add this to this ajax request.
Kind Regards
Hello,
There is a property in dialog called savekey – the first param enables/disables the second is the key code
|
1 2 3 4 |
... $grid->setNavOptions('edit',array( "savekey"=>array(true,13) )); ... |
This will save the form on when Enter key is pressed.
Kind Regards,
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top