HOW TO DISABLE SELECTED ROW IN EXTJS MVC?

Andrew Watson

Total Post:39

Points:273
Posted by  Andrew Watson
Mvc4 
 1837  View(s)
Ratings:
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;
        }}  }
    ),
  1. Tom Cruser

    Post:28

    Points:196
    Re: how to disable selected row in extjs mvc?

    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;

                       }

                }

            }

        },

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!