首页新闻招聘找找看知识库
  • 回复:1 浏览:3520 2010-03-17 15:17 来自 mzd

    各位大哥大姐好。小弟是刚学EXT的,现在碰到一个棘手的问题。在殷老师的博客里学到了右键删除的代码.但是将他贴到我自己的程序里就总提示rowIndex为定义。代码如下:

    var data=[
                    {header:'类型',dataIndex:'TRTY',name:'TRTY',renderer:prst},
                    {header:'地址',dataIndex:'TRMA',name:'TRMA'},
                    {header:'IP地址',dataIndex:'TRIP',name:'TRIP'},
                    {header:'告警,dataIndex:'TRER',name:'TRER',renderer:pctChange},
                    {header:'时间',dataIndex:'TRDA',name:'TRDA'},
                    {header:'设备名称',dataIndex:'TRNA',name:'TRNA'},                  
                    {header:'所在区域',dataIndex:'DLAR',name:'DLAR',hidden:true},
                    {header:'所在小区',dataIndex:'DLFR',name:'DLFR'},
                    {header:'所在街',dataIndex:'DLSE',name:'DLSE',hidden:true}          
                                  
                ];

    var store1=new Ext.data.GroupingStore({
                proxy:new Ext.data.HttpProxy({url:'../pro/INDEX.aspx?cmd=url'}),
                 reader:new Ext.data.JsonReader({root:"result",totalProperty:"totalPorperty"},data),
                groupField:'TRER',
                sortInfo:{field:'TRDA',direction:'desc'}
            });

    var grid= new Ext.grid.GridPanel({
                width:790,
                height:400,
                border:false,
                columns:data,
                sm:new Ext.grid.RowSelectionModel({singleSelect:true}),
                view:new Ext.grid.GroupingView({startCollapsed:false}),
                store:store1           
                    
            });
            var contextmenu=new Ext.menu.Menu({                                      
                                           items:[{ 
                                                text:'删除',
                                               pressed:true,
                                                handler:function(){ Edit(grid,rowIndex,e);

                                                                  }
                                                      }]
                                               }); 
                                        

    grid.on("rowcontextmenu",function(grid,rowIndex,e){
                                                     e.preventDefault(); 
                                                    contextmenu.showAt(e.getPoint());

                                                                                           }
                                               );

                function Edit(grid,rowIndex,e)
         {  var record = grid.getStore().getAt(rowIndex);

             var name=record.data.name;
            
                 }

     还有一个问题,怎么能把选中的值传到后台中C#那部分的代码怎么实现。谢谢了

     

  • lily_yuan
    2010-03-18 16:40 lily_yuan

    通过通过页面传值的方法提交到后台
    第1楼 回到顶楼
登录后才能评论,请先登录注册