脚本网格日期控件自动保存

/*SM5613网格日期控件自动保存*/
 1 function CalendarInputClick(gridId, rowIndex, columnName) {
 2     var txt = event.target || event.srcElement;
 3     var oldtext = txt.value;
 4     var tdcolname = columnName;
 5     var inputtext = "";
 6     var tablename = "";
 7     var callback = function (time) {
 8         if (time != null) {
 9             txt.value = time;
10             inputtext = time;
11             inputtext = inputtext.substr(0, 10);
12             GridCellChange(gridId, rowIndex, columnName);
13             tablename = "SM_CG_CGZB_TB";
14             var thisParent = $(txt).parent();
15             var id = thisParent.siblings("td[colname='ID']").text();
16             var sql = "update {3} set {0}=to_date('{1}','yyyy-mm-dd')  where ID={2}";           
17             sql = sql.format(tdcolname, inputtext, id, tablename, "铝件交期" + oldtext + "->" + inputtext);
18             $.ajaxEXEC(sql, function (data) {
19                 if (data != 1) {
20                     $("#lblMsg").text(data);
21                 }
22                 else {
23                     $("#lblMsg").text("[铝件交期]修改成功:" + inputtext);
24                     thisParent.parent().css({ "background-color": "LawnGreen" });
25                 }
26             });
27         }
28         txt = null;
29         gridId = null;
30         rowIndex = null;
31         columnName = null;
32     };
33     openWin('CalendarTime.aspx?showtime=true&time=' + txt.value, '', callback, { w: 300, h: 250 });
34 }

 

posted @ 2024-12-10 16:21  知行一体2  阅读(2)  评论(0编辑  收藏  举报