• extjs EditorGridPanel 编辑保存数据


    代码
    var editGridPanel = new Ext.grid.EditorGridPanel({
               cm: cm,
               store: store,
               autoScroll: 
    true,
               frame: 
    true,
               region: 
    'center',
               clicksToEdit: 
    1,
                tbar:[
                    comboTerm, comboExamName
                ],
               listeners: {
                   
    "afteredit"function(e) {
                       
    var r = e.record; //得到当前行所有数据
                       var f = e.field; //得到修改列
                       var v = e.value; //得到修改列修改后值
                       if (v == "") {
                           editGridPanel.getStore().reload();
                           
    return;
                       }
                       
    //通过ajax请求修改数据
                       Ext.Ajax.request({
                           url: 
    "StuScoreAjax.ashx?model=update",
                           method: 
    "POST",
                           params: {
                               FieldName: f,
                               UpdateValue: v,
                               ID: r.data.ID
                           },
                           success: 
    function(r) {
                               editGridPanel.getStore().reload();
                           },
                           failure: 
    function() {
                               MessageBox(
    "提示""操作失败!", Ext.MessageBox.ERROR);
                               editGridPanel.getStore().reload();
                           }
                       });
                   }
               }
           });
  • 相关阅读:
    2014/7/24
    POJ 3414 Pots BFS
    hdu5119 Happy Matt Friends(dp)
    hdu1285 拓扑排序+优先队列
    串口參数具体解释:波特率,数据位,停止位,奇偶校验位
    浅谈软件销售工作
    设计模式及其学习方法的个人理解
    Apache + Tomcat + JK 集群
    SpringMVC案例2----基于spring2.5的注解实现
    poj
  • 原文地址:https://www.cnblogs.com/barrysgy/p/1861179.html
Copyright © 2020-2023  润新知