现在的位置: 首页 > 综合 > 正文

关于Ext.grid.CheckboxSelectionModel点击事件时无法获得当前选择列的数据值

2013年09月07日 ⁄ 综合 ⁄ 共 1548字 ⁄ 字号 评论关闭

问题:页面选择一列。

如左边的灰色行,进入连接,得到起ID,比如是123,然后选择另外一列,得到的ID居然还是123

 

代码:这是以前的代码修订的,很乱,但是将就看吧,没办法,以前他们做的项目,现在拿来改起来真的是相当的头痛。

//得到选中的行这里进行了两次选中,无语。当然可以直接去掉合并成一个,这里只是为了还原当时的情况,所以保留到这里。程序中删除。

       if(Grid.selectedRow==null){

           Grid.selectedRow = Grid.grid.getSelectionModel().getSelected();//左键点选或勾选的行

       }else{//2011-04-26

           Grid.selectedRow = Grid.grid.getSelectionModel().getSelected();//这里我直接晕掉,它直接都从新加载了,可是还是会存在以前的记录为选中,不知道咋搞,直接让他重选。无语

 

合并为以前就用if语句就可以,现在必须用整体用它,其他代码难得看了,看的我脑壳好大。。。。。

Grid.selectedRow = Grid.grid.getSelectionModel().getSelected();

 

dealOnclicks : function(){

   

       //得到选中的行这里进行了两次选中,无语。当然可以直接去掉合并成一个,这里只是为了还原当时的情况,所以保留到这里。程序中删除。

       if(Grid.selectedRow==null){

           Grid.selectedRow = Grid.grid.getSelectionModel().getSelected();//左键点选或勾选的行

       }else{//2011-04-26

           Grid.selectedRow = Grid.grid.getSelectionModel().getSelected();//这里我直接晕掉,它直接都从新加载了,可是还是会存在以前的记录为选中,不知道咋搞,直接让他重选。无语

       }

       //var taskRule = Grid.selectedRow.data.taskRule;

       var linktoids = Grid.selectedRow.data['recordId'];

       //var doflags = Grid.selectedRow.data.opflag;

       //if(doflags==0){

           Ext.Ajax.request({

           //请求地址。注意:路径

               url:'<%=webapp%>/servlet/DoHttpServlet?action=dealsCheck&flag=http&ids=' + linktoids,

           //成功时回调

               success: function(response, options) {

               //获取响应的json字符串

               var responseArray = Ext.util.JSON.decode(response.responseText);

               if(responseArray.success==true){

               Grid.ds.reload();

          }

          }

           });

       //}

      

       //这里的返回没有效果,所以出现了问题,

   

},

抱歉!评论已关闭.