我在页面上有一个网格。当我单击行时 - 项目编辑表单,其中项目数据显示在对话框(jquery 对话框 ui 插件)中。问题是在单击对话框“保存”按钮后,使用新的用户输入从 html 中获取数据项。这是我的代码:
$('#OutLookAccountsGrid').on('click', 'span.btnOutlookAccountEdit', function () {
//getting data from grid row
var account = $(this).tmplItem().data;
//populating edit template with data
var tbl = $('#outlookaccountEditFormTmpl').tmpl(account);
//displaying edit form inside dialog
tbl.dialog({
modal: true,
width: 400,
buttons: {
"Yes": function () {
var $this = $(this);
//PROBLEM!!! PROBLEM!!! PROBLEM!!!
//want to get values from user, but instead getting old values
//populated from grid row
var data = $.tmplItem(this).data;
//...
//want to send tmplItem with new values throught ajax as data param
//...
}
}
})//end of dialog
})
是否可以获得具有新值的对象?