Thanks Tony, I figured it out…!!!
Probably you need to add to your colModel editable: true… Only the editable columns are being sent to the server… If you want your buttons on the navigator to do something else… then probably you need to add custom buttons. Otherwise, you can use the methods afterComplete, afterSubmit etc. to manage your data. Read the documentation for more information…
Yeah… actually I did find a solution. I hope this will help you…!!! 😀
jQuery().ready(function (){
jQuery(“#list1”).jqGrid({
colNames:['Username','Email', 'Rank', 'Status', 'Join Date', 'Login Date', 'Href'],
colModel:[
{name:'username',index:'username', sorttype: 'text', width:90, editable:true},
{name:'email', index:'email', width:90, editable:true, editrules:{required: true, email: true}},
{name:'rank',index:'rank', width:90, editable:true, edittype: 'select', editoptions: { value: “admin:Admin; user:User” }, editrules:{required:true}},
{name:'activate',index:'activate', width:100, editable:true, edittype: 'checkbox', editoptions: { value: '1:0' }, editrules:{required:true}},
{name:'join_date',index:'join_date', width:80, editable:false, align:”right”},
{name:'last_login_date',index:'last_login_date', width:100, editable:false},
{name:'href',index:'href', hidden:true, editable:true, width:100}
],
datatype: 'local',
altRows: false,
autowidth: true,
height: 205,
scroll: false,
scrollrows: true,
rowNum:10,
pginput: false,
rowList: false,
pager: jQuery('#pager1'),
sortname: 'db_address',
viewrecords: true,
loadonce: true,
forceFit: true,
loadui: 'block',
sortorder: “desc”,
caption:”Users”,
editurl:”include/jgrid_dummy.php”,
//subgrid settings
subGrid: true,
subGridRowExpanded: function(subgrid_id, row_id) {
subgrid_table_id = subgrid_id + 'row_id';
subgrid_pager_id = subgrid_id + 'row_id' + 'pager';
jQuery(“#”+subgrid_id).html(“
“);
jQuery(“#”+subgrid_table_id).jqGrid({
datatype: 'local',
colNames: ['Select','Insert','Update','Delete', 'Href'],
colModel: [
{name:”select”, index:”select”, sortable: false, editable:true, width:20, align:”center”, edittype: 'checkbox', editoptions: { value: '1:0' }},
{name:”insert”, index:”insert”, sortable: false, editable:true, width:20, align:”center”, edittype: 'checkbox', editoptions: { value: '1:0' }},
{name:”update”, index:”update”, sortable: false, editable:true, width:20, align:”center”, edittype: 'checkbox', editoptions: { value: '1:0' }},
{name:”delete_act”, index:”delete_act”, sortable: false, editable:true, width:20, align:”center”, edittype: 'checkbox', editoptions: { value: '1:0' }},
{name:'href',index:'href', hidden:true, sortable: false, editable:true, width:100}
],
datatype: 'local',
altRows: false,
autowidth: true,
height: 25,
scroll: false,
scrollrows: true,
rowNum:10,
pginput: false,
rowList: false,
pager: jQuery('#'+subgrid_pager_id),
sortname: 'db_address',
viewrecords: true,
loadonce: true,
forceFit: true,
loadui: 'block',
pgbuttons: false,
sortorder: “desc”,
caption:”DB Permissions”,
editurl:”include/jgrid_dummy.php”
});
FetchUserPerm(row_id, subgrid_table_id);
//pager2 (subgrid)
jQuery(“#”+subgrid_table_id).jqGrid('navGrid','#'+subgrid_pager_id,
{edit:true, add:false, del:false, refresh: false, search: false}, //options
{height:180,
reloadAfterSubmit:false,
closeAfterEdit: true,
checkOnUpdate: true,
checkOnSubmit: true,
beforeShowForm: function(form_id){
//$(“#password”).attr(“size”,”40″);
},
afterComplete: function(response, postdata, formid){
var su = jQuery(“#list1”).getGridParam(“selrow”);
SaveUserPerm(su, postdata);
}
} // edit options
);
}
});
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 ?
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…
Pricture: problem2_1, problem2_2
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…
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
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(){
Nevermind, I found it…!!!
Simple I add in a cell something like this
Link and it is working!
Thanks….
You have a great plugin!!!!
Hello again,
I have also an other question…..
Is there a way in a not edittable cell to have an active link and when someone press there to be redirected to that page?
The best would be without opening a new tab/window…
In the same the user is!
Thanks,
Mexis
Hello,
It is working….
Now the form isn't submitted when I save a row!
I thougth that it would be something much more complicated!!!
Thank you very, very much….!!!!
Have a nice day!!!:D
Mexis
Could you please give me some more info how to do that?
If you did this perhaps to paste the code…..If it is not trouble for you!
Thanks,
Mexis
Ok I did the simplest thing….
I get the div element of the grid outside of the form…. and that seems to working!!
But is there any way to know when a row is in edit mode, show with a function onSubmit in the form to return false and prevent the submit from happening?
I think this could help…..because its not right to have elements out of
After further examination I was wrong before…
If I remove the form element then it's working…like a charm.
Well, and with the form element the Post to editurl is actually taking place (i see the changes from phpmyadmin) but then is going to form action!
When I remove the action then the form is submitted to it self.
From firebug the ony I see (in both cases) is the get request and no Post, but the changes have been done. But actually the page has been sortove “refreshed” or submitted to form action. I think that I dont see the Post request for that reason. So the Post to my editurl is happening but because of the form element then it is submitted or to it self or to form action.
And the question is….Has anyone any idea how I can prevent this from happening? I really need the form element!!! 😀
Thank you very, very much!!!!
Ok Tony…
Thanks for your response…
I am waiting for your answer/solution…. 😉
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top