Hello
Here is the test code.
When deleting the last one is well supressed from the DB, ajax return null but the line remains in the JqGrid, even if we refresh via the refresh button.
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 |
var lastsel0001; jQuery("#IDTest0001").jqGrid({ url:'json.php?id=0001', styleUI : 'Bootstrap', datatype: "json", mtype: "POST", colNames:['ID','IDModels','Date', 'Label', 'Quantite','TypeDoc','Lieu'], colModel:[ {name:'IDTest',index:'IDTest', align:"center", editable:true, hidden:true}, {name:'IDModels',index:'IDModels',align:"center", editable:true,hidden:true}, {name:'Date',index:'Date', width:150,align:"center", editable:false, sorttype:"date"}, {name:'Label',index:'Label', width:450, editable:true}, {name:'Quantite',index:'Quantite', width:100, align:"right", editable:true}, {name:'TypeDoc',index:'TypeDoc', width:150, align:"center", editable:true, hidden:true, edittype: "select", formoptions: { label: 'TypeDoc' }, editoptions: { value:"Autre:Autre"}, editrules: {edithidden:true} }, {name:'Lieu',index:'Lieu', width:200, align:"center", editable:true, edittype: "select", formoptions: { label: 'Lieux' }, editoptions: { value:"1:espace A"}} ], height: 120, width :1100, rowNum:20, rowList:[20,50,100], pager: '#pagerIDTest0001', sortname: 'Date', sortorder: "desc", multiselect: false, footerrow : true, userDataOnFooter : true, onSelectRow: function(id){ if(id && id!==lastsel0001){ lastsel0001=id; jQuery('#IDTest0001').jqGrid('restoreRow',lastsel0001); } jQuery('#IDTest0001').jqGrid('editRow',lastsel0001,true, '', '', '', '', aftersavefunc); }, editurl: "edit.php?id=0001" }).gridResize({ minWidth:1160, minHeight:90, }).jqGrid('navGrid','#pagerIDTest0001',{add:true,edit:false,del:true, search:false}); function aftersavefunc(rowid, result) { $(this).trigger("reloadGrid"); } |
Hello,
So this is not enough?
rowattr: function (rd, curr, id) {
if (rd.Editable == 0) {
return {class ‘ui-state-disabled’};
}
},
May be easier with a little example because I do not see what to add.
Sorry JS is not my favorite 🙂
Kind Regards,
Chris
Hello,
I read everything and do the test in every way and it does not work.
In the demo link it works and I tested the same way but nothing to do … may be the bootstrap version of poses concern?.
I would do a test with no bootstap installation to see.
Nothing in the popup buttons are still active on the elements with the ui-state-disabled class on the Row.
Hello,
So if I followed just add this command:
styleUI : ‘Bootstrap’,
rowattr : function( rd, curr, id ) {
if(rd.Editable == 0 ) {
return {class : ‘ui-state-disabled’};
}
},
In the list of results it works. By cons in the pop-up that does not work.
Perhaps the bootstrap release?
Hello,
Thank you for the example, it works, non-editable lines are no longer “selectable”.
By cons when I take an editable line, I click the edit button, the pupup opens then there are the buttons, next, previous, which also allow access to non-editable lines. Is there a trick?
beforeSelectRow: function (rowid) {
var selRowId = $(this).getGridParam(‘selrow’),
if (selRowId !== rowid && rowData.Editable==0) {
$(rowid).addclass(“ui-state-disabled”);
}
return true;
},
Thank you
<span id=”result_box” class=”” lang=”en”>Hello,</span>
Thank you for the slopes.
For now I hide the publishing bottom of the table buttons, the concern is that I losque changes in the modal box there next previous boom, and it is possible to go change those not Authorized …
I wondered if there was not a function to say that a given line is not editable?
(Recess server side is checked, but it is cleaner to not have as client-side <span class=””>access)</span>
beforeSelectRow: function (rowid) {
var selRowId = $(this).getGridParam(‘selrow’),
tr = $(this.rows.namedItem(rowid)),
thisId = $.jgrid.jqID(this.id),
rowData = $(this).jqGrid(‘getRowData’, rowid);
console.log(rowData.Editable);
if (selRowId !== rowid && rowData.Editable==0) {
// eneble the “Edit” button in the navigator
$(“#edit_” + thisId).hide();
$(“#del_” + thisId).hide();
} else {
// unselect previous selected row
// disable the “Edit” and “Del” button in the navigator
$(“#edit_” + thisId).show();
$(“#del_” + thisId).show();
}
return true; // allow selection or unselection
},
Hello,
I have a jqGrid with a list of results (row).
I want the user has the right to modify some lines.
To see which line has the right to change, I have a column Right: 0/1
I hope to be more clear?
I found this example but the event does not fire when I out of my cell to switch to another.
Solution :
Solution :
data = $ (this) jqGrid (“getGridParam”, “data”);
returns nothing so how …. ?
I tried that, but nothing in the console.log (data);
I do not see how to get there 🙁
May pass while utf8_general_ci which simplifirait things ?
Solution :
Ajouter ce style :
.ui-jqgrid tr.jqgrow td {
Hello,
I have not found an example to use the events, DATAIN, DataEvent on http://trirand.com/blog/jqgrid/jqgrid.html
It's a shame because I think a lot of people are losing hope to make things further with this plugin, especially since French is look for good keywords to find what I want to do is not easy.
The I simply trying to recover the value of a field of a line to update a drop down list linked together:
Country and state
When editing a line I want to spent the id of the country to see the list of states in the country concerned in the other list:
…
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top