Stopping a particular ngGrid cell (not column) from being edited during ngGridEventStartCellEdit

Justin Dearing

I have an ngGrid with some individual cells (not columns) that I don't want to be edited. In my example plunk I want to not edit the cells where the row and column index are the same.

I tried preventDefault(), event.stopPropagation(), and an old fashioned return false; in my ngGridEventStartCellEdit but the cell still enters edit mode.

$scope.$on('ngGridEventStartCellEdit', function (event) {
    var row = event.targetScope.row.rowIndex;
    var col = event.targetScope.col.index - 1;
    if (row == col) {
        console.log("Not Gonna propagate");
        event.preventDefault();
        event.stopPropagation();
        return false;
    }
});

The console.log("Not Gonna propagate"); fires. What am I doing wrong?

Goodzilla

I tried using cellEditableCondition.

Here's the plunker with it. All you need is :

enableCellEdit: true,
cellEditableCondition: 'row.rowIndex !== col.index',

enableCellEdit has to be true for the editable condition to work.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to check if a particular cell in JTable is being edited?

From Dev

Debian: prevent particular file from being overwritten during package upgrade

From Dev

QTableView: dataChanged event clears cell being edited

From Dev

How to check if an Excel document cell is being edited

From Dev

Obtaining lines from an array and stopping at a particular character

From Dev

Keep batch file from being edited

From Dev

C# - Locking folders from being edited

From Dev

How to prevent a directory from being edited

From Dev

How to know whether QTableWidget's cell is (not) being edited?

From Dev

how to detect enter pressed while jtable cell is being edited?

From Dev

How to manually modify a cell that is being edited in a worksheet_change event?

From Dev

NSTableView update datasource with value from edited cell?

From Dev

Save edited cell/s from JTable to database

From Dev

how to add button in data table so , that the particular column can be edited

From Dev

Stopping a particular value from entering a mySQL table (PhpMyAdmin)

From Dev

Go to particular cell by finding text in the column EXCEL

From Dev

Go to particular cell by finding text in the column EXCEL

From Dev

Row header and column header for a particular cell in table

From Dev

How to delete rows from excel files if a cell in a particular column contains the string of array?

From Dev

Is there a way to protect all existing rows from being edited in an SQL table?

From Dev

Prevent cell from being calculated

From Dev

Stopping Capybara + Selenium from opening a browser window during JS tests

From Dev

before_destroy callback not stopping record from being deleted

From Dev

Having trouble stopping duplicate from being added to array

From Dev

jQuery code is stopping the products from being inserted into the database

From Dev

Reading particular cell value from excelsheet in python

From Dev

Extracting a cell from two matrix and a particular condtion

From Dev

Extracting a cell from two matrix and a particular condtion

From Dev

Filling a column from a cell

Related Related

  1. 1

    How to check if a particular cell in JTable is being edited?

  2. 2

    Debian: prevent particular file from being overwritten during package upgrade

  3. 3

    QTableView: dataChanged event clears cell being edited

  4. 4

    How to check if an Excel document cell is being edited

  5. 5

    Obtaining lines from an array and stopping at a particular character

  6. 6

    Keep batch file from being edited

  7. 7

    C# - Locking folders from being edited

  8. 8

    How to prevent a directory from being edited

  9. 9

    How to know whether QTableWidget's cell is (not) being edited?

  10. 10

    how to detect enter pressed while jtable cell is being edited?

  11. 11

    How to manually modify a cell that is being edited in a worksheet_change event?

  12. 12

    NSTableView update datasource with value from edited cell?

  13. 13

    Save edited cell/s from JTable to database

  14. 14

    how to add button in data table so , that the particular column can be edited

  15. 15

    Stopping a particular value from entering a mySQL table (PhpMyAdmin)

  16. 16

    Go to particular cell by finding text in the column EXCEL

  17. 17

    Go to particular cell by finding text in the column EXCEL

  18. 18

    Row header and column header for a particular cell in table

  19. 19

    How to delete rows from excel files if a cell in a particular column contains the string of array?

  20. 20

    Is there a way to protect all existing rows from being edited in an SQL table?

  21. 21

    Prevent cell from being calculated

  22. 22

    Stopping Capybara + Selenium from opening a browser window during JS tests

  23. 23

    before_destroy callback not stopping record from being deleted

  24. 24

    Having trouble stopping duplicate from being added to array

  25. 25

    jQuery code is stopping the products from being inserted into the database

  26. 26

    Reading particular cell value from excelsheet in python

  27. 27

    Extracting a cell from two matrix and a particular condtion

  28. 28

    Extracting a cell from two matrix and a particular condtion

  29. 29

    Filling a column from a cell

HotTag

Archive