Hello Tony,
I posted the pull request which contains the changes in addJSONData and normalizeData required to fix problem with the usage key:true in combination with the reader (jsonReader or localReader) having repeatitems:true.
Here is the modified version of jquery.jqGrid.src.js.
The problem come after you changed old keyIndex option to keyName. It was done to fix problem with non-updated keyIndex option after resorting columns in jqGrid (by usage columnChooser or drag and drop of column headers in case of the usage sortable:true).
I hope that I tested all possible cases.
Best regards
Oleg
Hi,
usage of demos simplify all. The reason of the problem with sending wrong idCity – the rowids of the grid will be wrong assigned. It’s a bug in jqGrid. The bug exists in combination of the usage of arrays of strings as the input value of row like [“13570″,”Some name 1″,”Australia”] and the usage of key:true property in colModel. I will post later to github my suggestion how to fix the problem. As the workaround I suggest you to add jsonReader : {id: 0} option and remove key:true property from the first column definition.
See http://jsfiddle.net/OlegKi/d26hzhu6/3/
About the problem with the requirement to post idCity=3 instead of the text “Australia” I wrote you two times before. You used wrong configuration which worked in old versions of jqGrid, but the but are fixed some years ago (probably in the version 4.4.5). So you should decide whether you want that jqGrid hold values like 1,2,3 in idCity column (and displays still the texts “London”, “Washington”, “Australia”) or you use the texts “London”, “Washington”, “Australia” in the data. In the first case you the communication with the server will be in ids 1,2,3, but the values have to be used in both input of grid and the output. Exactly the example I used in the modified demo. Alternatively you can fill jqGrid with the data like “London”, “Washington”, “Australia”, but exactly the same data will be send to the server during editing.
You still can use serializeEditData to remap any standard values like “London”, “Washington”, “Australia” to 1,2,3 or on the contrary, but I don’t recommend you to do so because I personally find such kind on communication transfer non-consequent.
Best regards
Oleg
If you have an interest to prepare the jsfiddle demo which uses Ajax you can use http://jsfiddle.net/OlegKi/ntfw57zm/ as an example.
I can repeat that I think that you use wrong value editoptions:{ value:”1:London;2:Washington;3:Australia”}. You use “Australia” and “Washington” in the input data. So you don’t use ids in the input data. It means that editoptions:{ value:”London:London;Washington:Washington;Australia:Australia”} will be correct.
If you do want to use ids in the idCity column you should use [[“13570″,”Some name 1″,”3”],[“34233″,”Some name2″,”Washington”]] and
1 2 3 4 5 6 7 |
colNames: ['person', 'idCity'], colModel: [ {name:'person', editoptions:{size:39}, width:190}, {name:'idCity', edittype:'select', formatter:'select', width:90, editoptions:{ value:"1:London;2:Washington;3:Australia"}} ], cmTemplate: {editable:true} |
In the way the data will hold only ids in idCity column but display texts. formatter:’select’ do the mapping. Because you use prmNames: {id: “idPer”, …} no hidden idPer column is required.
Best regards
Oleg
To fix the problem one have to debug the code. So one needs to have the working demo which uses uncompressed version of jqGrid jquery.jqGrid.src.js (instead of jquery.jqGrid.min.js). If one can see that wrong information will be posted to the server that one don’t need and server part to debug such demo. So please prepare always a working demo if you report the bug.
About the first issue which you report all sounds very strange. You write about “the id’s of the combos instead of the text“. So you use probably select with options having different value and the text. It seems me wrong if you use edittype:’select’ and not uses formatter:’select’. One uses different values and texts in select options only in the case that one fill the data with ids (values), but one want to display the texts for the user. formatter:’select’ do that. The only disadvantage of the approach is that the formatter have to know the mapping between ids and the texts during filling of the grid. One can’t make an additional asynchronous call to the server. So one uses formatter:’select’ with editoptions.value instead of usage of editoptions.dataUrl. If one need still build dynamic values of editoptions.value one can set it inside of beforeProcessing callback. See the answer for more details.
About the problem with the date format you should try to use reformatAfterEdit: true option of formatter: “date”.
Best regards
Oleg
It’s a basis design part of the jqGrid implementation. Do you tried to set fixed height (some integer value) of jqGrid, so that vertical scroll bar appears? In the case the vertical scroll bar exist only in the body of the grid. During vertical scrolling the column header (which can contains searching toolbar or other elements) will stay on it’s place and only the grid data will be scrolled. There are some implementation alternatives which have always some disadvantages and restrictions in different version of web browser. So one have to make a choice and to follow it.
Best regards
Oleg
Sorry, but where you get so bad code example!!!??? Please never fill the grid with respect of addRowData. The simplified code which do the same is http://jsfiddle.net/OlegKi/usqgrnau/3/. The problem is that the code of the example is still buggy. It uses
1 |
hidden: 'true' |
 instead of
1 |
hidden: true |
It’s not the same values. So the demo is buggy and the only problem which I see is that jqGrid generate a little strange looking grid in the case of wrong input data. Nevertheless one can change the code of jqGrid a little to improve the look of results in case of usage wrong type of hidden property of colModel. One can improve the code of jqGrid by replacing the lineÂ
1 |
if( ts.p.colModel[j].hidden ) { |
to
1 |
if (ts.p.colModel[j].hidden === true) { |
(like the line of formatCol do) and the lineÂ
1 |
if(!ts.p.colModel<em class="d4pbbc-italic"></em>.hidden) { |
toÂ
1 |
if (!ts.p.colModel<em class="d4pbbc-italic"></em>.hidden === true) { |
Best regards
Oleg
I wanted just add that
1 |
table.ui-jqgrid-btable { min-height: 1px; } |
seems be better as
1 |
table.ui-jqgrid-btable { height: 1px; } |
Best regards
Oleg
If a problem exist one should provide the demo and the test case which describes how the problem can be reproduced.
Best regards
Oleg
Sorry, but it seems to me that you didn’t read the referenced answer. I repeat: I suggest to create navGrid with all buttons which you could need make visible later. Then you hide unneeded buttons directly after creating and show it later when the button will be needed. The demo from the answer demonstrates how buttons from navGrid can be shown or hidden.Â
Regards
Oleg
Hi,
the reason of the problem is the bug described starting from here. The bug should be already fixed in jqGrid code on github. As the workaround you can have two other options (one from the above workarounds can be used) which works in jqGrid 4.6.0:
I hope that Tony will publish the current jqGrid code from github as new release of jqGrid.
Best regards
Oleg
Hi Vignesh,
look at the answer and this one in which included the corresponding demos. The idea is very easy: one can create all buttons and hide currently unneeded buttons. Later one can make some buttons visible depend on which row is selected. Alternatively on can disable/enable buttons instead of showing/hiding.
Best regards
Oleg
Hello Edotom,
it’s definitively not a bug. Expanding of the subgrid is not the same as selection. Many subgrid can be expanded, but no row can be selected or the selected row can have no relation to the selected row.
You don’t describe what exactly you try to do. The most scenarios can be implemented by usage subgrid callbacks (see the documentation). If you need to test whether some row is expanded (the “+” icon from the subgrid column was clicked before) then you can first get
Best regards
Oleg
Hello Tony,
I expect possible memory leeks problems more in deleting of existing rows (in emptyRows), but placing replacing the table body with new content, where the only existing row is the first one, (at least in case of scroll:false) seems me safe. It’s strange, but setting of ts.grid.bDiv.scrollTop to 0 (even it the old value is already 0) take really a lot of time. I could not find any case when the setting is needed. Probably you can remind you better about such cases or just the condition in “if” is wrong.
In any way it’s good to test the suggested modification.
Best regards
Oleg
P.S. Please don’t forget about the pull request and about the post when you find time for it. We wait for new release of jqGrid too. Best wishes!Â
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top