Forum
19:44
05/02/2009
Hello Tony,
First of all I want to say thank you for this excellent grid. I have some problems with cell edit and I need your help.
1) When someone press an editable cell and then press to sort something when he returns to the cell, the html tag then appears
<input name=”amount” id=”2_amount” style=”width: 98%;” type=”text”>
2) When a user has select a editable cell and delete the row then the grid is not “responding”. Well you can add new rows, but you can not see the indicator of what row you have select or edit any cells. Something like “half froze”!
According to 1 I know that has been mentioned by an other user but there was no answer. Also i found this
http://www.trirand.com/blog/?p.....ing/page-1
He can not sort when he is in edit mode. Furthermore i tried with beforeEditCell to disable the sortable but with no luck.
My jgrid conf is something like that
jQuery(document).ready(function(){
var lastSel;
jQuery(”#list2″).jqGrid({
url:'include/jgrid.php?nd='+new Date().getTime(),
datatype: “json”,
colNames:['ID','Κωδ.','Περιγραφή', 'Τεμ/Κιβ.', 'ΠοσÏŒτητα'],
colModel:[
{name:'id',index:'id', width:10, sortable: true, sorttype:"int", hidden:true, editrules:{edithidden:true} },
{name:'code', sortable: true, width:10, sorttype:"text" },
{name:'desc',index:'description', width:100, sortable: true, editable:false, sorttype:"text" },
{name:'item',index:'item', width:12, sortable: true, editable:false, sorttype:"text" },
{name:'amount',index:'amount', sortable: true, editable:true, width:15, sorttype:"int", formatter:'integer', editrules:{required: true, integer: true, minValue: 1} } //formatter:'checkbox',editoptions:{value:“true:false”}
],
pager: jQuery('#pager2'),
rowNum:10,
rowList:[10,20,30],
imgpath: '../admin/js/jgrid/themes/basic/images',
sortname: 'sequence',
viewrecords: true,
cellEdit: true,
cellurl: “include/jgrid_update.php”,
cellsubmit: “clientArray”,
sortorder: “asc”,
caption: “ΠροÏŠÏŒντα”,
width: 825,
height: 250,
loadonce: true,
editurl:”include/jgrid_update.php”,
pager: jQuery('#pager2'),
onSelectRow: function(id){
if(id && id!==lastSel){
jQuery('#list2').restoreRow(lastSel);
lastSel=id;
}
jQuery('#list2').editRow(id, true );
},
onRightClickRow: function(id){
alert(”Δεν επιτρÎπεται το δεξί κλικ!”);
return false;
},
afterSaveCell: function(id){
$('#list2 td.dirty-cell').removeClass(”dirty-cell edit-cell”);
$('#list2 tr.edited').removeClass(”edited”);
},
afterEditCell: function(id){
//alert(”test 2″);
},
beforeEditCell: function(id){
//alert(”test 345″);
jQuery(”#list2″).setColProp('amount',{sortable: true});
}
});
jQuery(”#list2″).navGrid('#pager2',
{refresh: false, edit: false, add: false, del: false, search: false},
{height:280,reloadAfterSubmit:false}, // edit options
{height:280,reloadAfterSubmit:false}, // add options
{reloadAfterSubmit:false}, //delete options
{reloadAfterSubmit:false}
).navButtonAdd('#pager2',{
caption:”Delete”, buttonimg:”../admin/js/jgrid/themes/steel/images/row_delete.gif”, onClickButton: function delRow(){
var id = jQuery(”#list2″).getGridParam('selrow');
var su=jQuery(”#list2″).delRowData(id);
if (!su){
alert (”You don't have choose any products!”);
}
}
}).navButtonAdd('#pager2',{
caption:”Clear All”, buttonimg:”../admin/js/jgrid/themes/steel/images/tab_close-on.gif”, onClickButton: function clearAll(){
var su=jQuery(”#list2″).clearGridData();
}
});
Am I doing something wrong?
Regards,
Dimitris Mexis
02:45
Moderators
30/10/2007
Hello,
If I look in you configuration you use both - inline edit and cell edit. Also to be a clear - you should either use cellEdit: true without using editRow and restoreRow or vice versa.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
03:53
05/02/2009
Hello Tony and thanks for your response!
I corrected my config. Or I think.. Now it must be ok!!! 😀
But I am still having the same isues as I mentioned before.
jQuery(document).ready(function(){
var lastSel;
jQuery("#list2").jqGrid({
// the url parameter tells from where to get the data from server
// adding ?nd='+new Date().getTime() prevent IE caching
url:'include/jgrid.php?nd='+new Date().getTime(),
datatype: "json",
colNames:['ID','Κωδ.','Περιγραφή', 'Τεμ/Κιβ.', 'ΠοσÏŒτητα'],
colModel:[
{name:'id',index:'id', width:10, sortable: true, sorttype:"int", hidden:true, editrules:{edithidden:true} },
{name:'code', sortable: true, width:10, sorttype:"text" },
{name:'desc',index:'description', width:100, sortable: true, editable:false, sorttype:"text" },
{name:'item',index:'item', width:12, sortable: true, editable:false, sorttype:"text" },
{name:'amount',index:'amount', sortable: true, editable:true, width:15, sorttype:"int", formatter:'integer', editrules:{required: true, integer: true, minValue: 1} } //formatter:'checkbox',editoptions:{value:“true:false”}
],
pager: jQuery('#pager2'),
rowNum:10,
rowList:[10,20,30],
imgpath: '../admin/js/jgrid/themes/basic/images',
sortname: 'sequence',
viewrecords: true,
forceFit: true,
sortorder: "asc",
caption: "ΠροÏŠÏŒντα",
width: 825,
height: 250,
loadonce: true,
cellEdit: true,
cellurl: "include/jgrid_update.php",
cellsubmit: "clientArray",
pager: jQuery('#pager2'),
onRightClickRow: function(id){
alert("Δεν επιτρÎπεται το δεξί κλικ!");
return false;
},
afterSaveCell: function(id){
$('#list2 td.dirty-cell').removeClass("dirty-cell edit-cell");
$('#list2 tr.edited').removeClass("edited");
},
afterEditCell: function(id){
//alert("test 2");
},
beforeEditCell: function(id){
//alert("test 345");
//jQuery("#list2").setColProp('amount',{sortable: true});
}
});
In the
cellurl: "include/jgrid_update.php",
The jgrid_update.php it has only one line
echo true;
Is that a problem....?
For alive example..
http://mexis.homeftp.org/durostick/partners/login.php
Use for Username (ÎŒνομα Χρήστη): 10.0049
It's for a Greek Project.... so the language is Greek.
In that page you have two autocomplete fields.
In the second write the keyword "Duro" and you will have some results.
When you click on a result then I add the product in the grid.
Anyway, you will fingure it out. The page is a Demo of course, so dont worry! 😀
Thanks...
04:36
Moderators
30/10/2007
Hello,
Replace
cellurl: “include/jgrid_update.php”,
with
editlurl: “include/jgrid_update.php”,
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
05:08
05/02/2009
Hello Tony and thanks again!
I am sorry for the wrong conf. I thought that with celledit we have to use cellurl.
Ok, I replace it but again I have the same issues.
1) When I delete a row that I have click on the editable field then the grid is "frozen". If I delete a row but I have choose not an editable field, I don't have any problems.
Do I have to return something specific by jgrid_update.php?
2) When I am in an editable field A when I press to sort something and then go to an ediatable field B, the A is not closed as it sould be. And if I return to the A then in the field I see html... something like that...
<input name=”amount” id=”2_amount” style=”width: 98%;” type=”text”>
How can I make the grid when I click outside of a cell to close any cell that is in edit mode?
And why does the html DOM appears?
Regards,
Mexis
05:20
05/02/2009
I have some print screen here if they help you...
http://mexis.homeftp.org/problem/
1) When I delete a row that I have click on the editable field then the grid is “frozen”. If I delete a row but I have choose not an editable field, I don't have any problems.
As you can see after I delete the row then I can't even choose a row. Actually it doesn't appear the color selection but if I press delete then it will delete it even the row it isn't appeared selected. And I can't edit a cell after the deletion.
Picture: problem1
2) When I am in an editable field A when I press to sort something and then go to an ediatable field B, the A is not closed as it sould be. And if I return to the A then in the field I see html… something like that…
<input name=”amount” id=”2_amount” style=”width: 98%;” type=”text”>
Pricture: problem2_1, problem2_2
06:02
Moderators
30/10/2007
Hello,
You use jqGrid 3.4 beta 2. Please upgrade to the latest, where you can not sort while in edit mode.
For me deleting work perfect. Also n problems
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
06:30
05/02/2009
Hello,
I installed jQuery Grid Plugin 3.4.3 but I still have the same problems.
Anyway, I guess then I am doing something wrong. Thanks for your help really...
I will use row, inline edit where I dont have any problems.
How can I disable sort in edit mode?
By setting
jQuery("#list2").setColProp('amount',{sortable: false});
on beforeEditCell ?
02:18
Moderators
30/10/2007
Hello,
Clear your cache. Sortable property can not be changed dynamically.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
47 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66