zoukankan      html  css  js  c++  java
  • 右键删除选中的行总提示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({
                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;
            
                 }

  • 相关阅读:
    Node.js v0.10.1 稳定版发布
    PHP 5.5.0 Alpha6 发布
    DataNucleus Access Platform 3.2 正式版发布
    Swipe 2.0 发布,移动端滑动 JS 库
    Kamailio 4.0 发布,开源的SIP服务器
    PeerJS 0.1.7:一个用于浏览器内P2P的WebRTC封装器
    Apache Libcloud 0.12.3 发布
    IE 10将加强对Flash的支持
    JBoss Portlet Bridge 3.2.0.Beta2 发布
    如何在遗留代码基础上开发
  • 原文地址:https://www.cnblogs.com/soundcode/p/2318846.html
Copyright © 2011-2022 走看看