---
title: "how to disable selected row in extjs mvc?"  
description: "how to disable selected row in extjs mvc?"  
author: "Anonymous User"  
published: 2014-11-09  
updated: 2014-11-10  
canonical: https://www.mindstick.com/forum/2542/how-to-disable-selected-row-in-extjs-mvc  
category: "asp.net mvc"  
tags: ["mvc4"]  
reading_time: 1 minute  

---

# how to disable selected row in extjs mvc?

I am using checkboxmodel to [select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) rows but i want to make some rows to be [selection](https://www.mindstick.com/blog/60/populate-records-in-second-listbox-according-to-the-selection-in-first-list-box) disabled based on some logic... here is my what i [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) but 'beforeselect' [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) 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;
        }}  }
    ),
```

## Replies

### Reply by Tom Cruser

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;                   }            }        }    },
```


---

Original Source: https://www.mindstick.com/forum/2542/how-to-disable-selected-row-in-extjs-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
