【发布时间】:2015-07-03 12:18:57
【问题描述】:
我有两个 jqgrid。从第一个网格中选择任何行时,我的第二个网格正在加载。我想编辑第二个网格(使用内联编辑)。第二个网格中有一个列“voucherDate”,第一个网格中有一个“loanReason”列。 Datepicker 用于编辑凭证日期列。
现在我想要在这个日期选择器中设置 minDate 属性,并且 minDate 应该是第一个网格的“loanReason”。我无法做到这一点。下面是一些代码sn-p。
第二个网格的ColModel
{name : 'voucherDate', index : 'voucher_date',width : 150, align: "center", editable : true, editoptions:{size:20,
dataInit:function(el){
$(el).datepicker({
dateFormat:'dd-M-yy',
changeMonth: true,
changeYear: true,
numberOfMonths: 1,
maxDate : '${currentDate}'
});
}},
search : true, searchoptions: { dataInit: repaymentDateSearch, sopt: ['eq','cn'] }, sortable : true }
第一个网格的ColModel
{name : 'loanReason', index : 'tcl.loan_date',width : 130, align: "center",
searchoptions: { dataInit: initDateSearch, sopt: ['cn'] },
editable : true, editoptions : {readonly : 'readonly'}
}
我试图通过在 datepicker 的 minDate 属性中使用以下代码(cboLoanEditList 是第一个网格的名称)来执行此操作,但这不起作用:
var row = jQuery("#cboLoanEditList").jqGrid('getRowData',editedRow);
var loanDate = row.loanReason;
【问题讨论】:
标签: javascript jquery jqgrid datepicker