|
editdata jqgrid передача данных при рекдактировании
#37838834
Ссылка:
Ссылка на сообщение:
Ссылка с названием темы:
|
|
|
|
Всем хай !
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. 49. 50. 51. 52. 53. 54. 55. 56.
$("#DataEnergy").jqGrid({
url: '/_DataEnergy/GetResurs',
datatype: 'json',
mtype: 'GET',
jsonReader: {
page: "page",
total: "total",
records: "records",
root: "rows",
repeatitems: false,
id: "Id"
},
colNames: ['#', 'Факт', 'Ед.изм', 'Месяц', 'Год', ],
colModel: [
{ name: 'Id', index: 'Id', key: true, width: 10, editable: false },
{ name: 'value', index: 'value', width: 20, editable: true },
{ name: 'name', index: 'id_unit', width: 5, align: 'right', editable: true,
edittype: "select", editoptions: { dataUrl: '/_DataEnergy/fillDrop?id=unit' }
},
{ name: '_month', index: '_month', width: 20, align: 'right', editable: true,
edittype: "select", editoptions: { dataUrl: '/_DataEnergy/fillDrop?id=month' }
},
{ name: '_year', index: '_year', width: 20, editable: true,
edittype: "select", editoptions: { dataUrl: '/_DataEnergy/fillDrop?id=year' }
}],
width: 850,
height: 450,
rowNum: 50,
pager: '#pagergrid'
, editurl: '/_DataEnergy/SaveGrid/'
});
$("#DataEnergy").jqGrid('navGrid', '#pagergrid',
{}, //options
{editdata: { id_res: $('#resurs').val(), id_obj: readCookie('id_obj')} },// add options
{editdata: { id_res: $('#resurs').val(), id_obj: readCookie('id_obj')} }, // edit options
{editdata: { id_res: $('#resurs').val(), id_obj: readCookie('id_obj')} }, // del options
{} // search options
);
$("#resurs").change(function () {
$('#DataEnergy').setGridParam({ postData: { id_res: $('#resurs').val(),
id_obj: readCookie('id_obj')
}
})
.trigger('reloadGrid');
});
$("#tempyear").change(function () {
document.getElementById("year").value = $("#tempyear").val();
});
</script>
Данные определенные в editdata не передаются при редактировании в postdata почему?????
|
|
|