मेरे पास फॉर्म डेटा के विभिन्न बिट्स और एक jqGrid के साथ एएसपीनेट एमवीसी 3 ऐप है।एक ही समय में नियंत्रक को फॉर्म डेटा और jqGrid (editUrl) डेटा को पास करने के लिए कैसे करें
जब मैं jqGrid में एक पंक्ति संपादित करता हूं तो मुझे ग्रिड डेटा के साथ-साथ कुछ फॉर्म टुकड़े को संपादन यूआरएल नियंत्रक को पोस्ट करने की आवश्यकता होती है।
मैं jqGrid संपादित डेटा को मेरे नियंत्रक को editUrl के माध्यम से ठीक से पोस्ट कर सकता हूं।
क्या ऐसा करने का कोई तरीका है?
मुझे यकीन नहीं है कि अन्य फॉर्म तत्व कैसे भेजें और उन्हें मेरे नियंत्रक में कैसे प्राप्त करें।
किसी भी मदद की सराहना की जाएगी।
नीचे मेरी jqGrid है:
$("#jqTable").jqGrid({
// Ajax related configurations
url: '@Url.Action("_CustomBinding")',
datatype: "json",
mtype: "POST",
postData: {
programID: function() { return $("#ProgramID option:selected").val(); },
buildID: function() { return $('#Builds option:selected').val(); }
},
// Specify the column names
colNames: ["Actions", "Assembly ID", "Assembly Name", "Assembly Type", "Cost", "Order", "Budget Report", "Partner Request", "Display"],
// Configure the columns
colModel: [
{ name: 'myac', width: 80, fixed: true, sortable: false, resize: false, formatter: 'actions', formatoptions: { keys: true} },
{ name: "AssemblyID", key: true, index: "AssemblyID", width: 40, align: "left", editable: false },
{ name: "AssemblyName", index: "AssemblyName", width: 100, align: "left", editable: true, edittype: 'select',
editoptions: {
dataUrl: '@Url.Action("_Assemblies")',
buildSelect: function (data) {
var response = jQuery.parseJSON(data);
var s = '<select>';
if (response && response.length) {
for (var i = 0, l = response.length; i < l; i++) {
var ri = response[i];
s += '<option value="' + ri + '">' + ri + '</option>';
}
}
return s + "</select>";
}
}
},
{ name: "AssemblyTypeName", index: "AssemblyTypeName", width: 100, align: "left", editable: false, edittype: 'select' },
{ name: "AssemblyCost", index: "AssemblyCost", width: 50, align: "left", formatter: "currency", editable: true },
{ name: "AssemblyOrder", index: "AssemblyOrder", width: 50, align: "left", editable: true },
{ name: "AddToBudgetReport", index: "AddToBudgetReport", width: 100, align: "center", formatter: "checkbox", editable: true, edittype: 'checkbox' },
{ name: "AddToPartnerRequest", index: "AddToPartnerRequest", width: 100, align: "center", formatter: "checkbox", editable: true, edittype: 'checkbox' },
{ name: "Show", index: "Show", width: 50, align: "center", formatter: "checkbox", editable: true, edittype: 'checkbox'}],
// Grid total width and height and formatting
//width: 650,
//height: 220,
altrows: true,
// Paging
//toppager: true,
pager: $("#jqTablePager"),
rowNum: 10,
rowList: [10, 20, 30],
viewrecords: true, // Specify if "total number of records" is displayed
emptyrecords: 'No records to display',
// Default sorting
sortname: "AssemblyID",
sortorder: "asc",
// Grid caption
caption: "Build Template",
// grid command functionality
editurl: '@Url.Action("_AjaxUpdate")',
onSelectRow: function (AssemblyID) {
if (AssemblyID && AssemblyID !== lastsel) {
$('#jqTable').jqGrid('restoreRow', lastsel);
$("#jqTable").jqGrid('editRow', AssemblyID, true);
lastsel = AssemblyID;
}
}
}).navGrid("#jqTablePager",
{ refresh: false, add: false, edit: false, del: false },
{}, // settings for edit
{}, // settings for add
{}, // settings for delete
{sopt: ["cn"]} // Search options. Some options can be set on column level
);
आपकी प्रतिक्रिया ओलेग के लिए धन्यवाद। मैं आपके उत्तर और टॉमसज़ के जवाब का मिश्रण उपयोग करूँगा। – Squeal
@ स्क्वाल: आपका स्वागत है! – Oleg