Results 1 to 2 of 2

Thread: Dynamic field handling in a Grid column.

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Vote Rating

    Default Dynamic field handling in a Grid column.

    I am somewhat new to ext js and have adopted a code base on a project I need to maintain going forward. The system uses Ext Js to make a editable spreadsheet of data records. I am currently trying to make an update which I have hit a dead end at. Lets take an example. I have a column for a status type. Options are New, In-progress, Complete. If the status on the record is not "Complete" when the user clicks on the cell it should give them a select list of the two options New or In-Progress. Certain other events that manipulate the data will change the record to status complete. When this occurs, if the cell is displaying the status 'complete' it will not be editable.

    My issue is I can only seem to do one or the other. I can make the column support the cells to be select lists or I can make the column un-editable. I cannot figure out how to handle each cell in its own way based on its value. Here is what the parts of the code would look like. (The actual code is jumbled into a lot of dynamically written files, and I unfortunately cant share those.)

    Field Definition...
    var status_store = Ext.create('', {
        fields: ['text', 'value', 'ct'],
        data: [
                    { 'text': 'New', 'value': 'New' },
                    { 'text': 'In-Progress', 'value': 'In-Progress' }
    var status_field = {
        xtype: 'combobox',
        selectOnTab: true,
        lazyRender: true,
        store: status_store,
        displayField: 'text',
        valueField: 'value',
        forceSelection: true
    Column Definition...
    var row_columns = [{
    text: 'Fields', locked: true, hideable: false, sortable: false, width: 400, columns: [{
    text: 'Status', hideable: false, width: 100, dataIndex: 'status', field: status_field, sortable: true
    I have found that using the code this way will use the select list for every cell in the column. If i remove the field property on the column definition it just renders the value statically. I want a way to detect if the value of the cell will be "Complete" and if it is remove the reference to the select list field definition.

    Is this possible? Or should I be attempting this in a completely different way.


  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    Have you tried returning false in the beforeedit event on the grid panel? That should prevent editing
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts