Home > DeveloperSection > Forums > how to disable selected row in extjs mvc?
Andrew Watson
Andrew Watson

Total Post:39

Points:273
Posted on    November-09-2014 10:38 PM

 ASP.NET MVC Mvc4 
Ratings:


 1 Reply(s)
 1137  View(s)
Rate this:
i am using checkboxmodel to select rows but i want to make some rows to be selection disabled based on some logic... here is my what i am trying but 'beforeselect' function doesn't even fires

selModel: Ext.create('Ext.selection.CheckboxModel', {
      checkOnly: true,
    mode:'multi',
   listeners: {
     beforeselect:function(grid){
    var grid=Ext.getCmp('mylist');     
        var selectionModel=grid.getSelectionModel();
    var selectedRecords=selectionModel.getSelection();
    var myValue=selectedRecords[0].get('nowreceive');
    var myvalue1=selectedRecords[0].get('received');
    if(myValue>myvalue1)
    {return false;}
    else 
    return true;
        }}  }
    ),


Tom Cruser
Tom Cruser

Total Post:28

Points:196
Posted on    November-10-2014 12:49 AM

beforecellmousedown event in the view config works for me.This is done in the viewconfig of the grid.

 viewConfig: {

 listeners: {

 beforecellmousedown: function(view, cell, cellIdx, record, row, rowIdx, eOpts){

               var myvalue=record.get('quantity_ordered');

               var myvalue1=record.get('quantity_received')

               if(myvalue==myvalue1)

               {

               return false;

               }

                   else {

                   return true;

                   }

            }

        }

    },


Don't want to miss updates? Please click the below button!

Follow MindStick