1. #1
    Sencha Premium Member
    Join Date
    Apr 2013
    Posts
    55
    Vote Rating
    1
    extjs.mscit is on a distinguished road

      0  

    Default Unanswered: Add one more state event for columns.

    Unanswered: Add one more state event for columns.


    I want to add one more state event for column name "setFixValue", which is similar to filter.
    All foreign key columns in grid, will fire this event.
    there will be a combobox, which will load all vaule. For example UserId, will show combobox with UserName, and one can select it and hit "set" button, and "setClick" will save this value in State.

    Everything is working fine, but how to add state event??

    NOTE: on button click, I have object of "Ext.grid.column.Column" only. I do not want to fireevent from Grid. But from Column.
    i.e very simillar way to "setSortState: function(state, skipClear, initial) {".

    Where to add stateEvent name "setFixValue"??

    Any idea.

    Thanks in advance.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    871
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So you want to use the stateEvents config on the Column? Should be able to set it in the columns array config in the grid.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2013
    Posts
    55
    Vote Rating
    1
    extjs.mscit is on a distinguished road

      0  

    Default stateChange event should invoke.

    stateChange event should invoke.


    Yes.

    Please find my code below.

    Code:
    var provider = new Ext.state.Provider();
    provider.on( "statechange", me.setDatabaseState );

    These 2 lines are added to each grid page. It invoke {setDatabaseState} function on "columnResize", "columnShow", "columnHide", "sortChange" and save into database.

    Now I want to add one more state event called "setfixvalue".

    So when user click on "ok" button, i will fire event manually like below, and it shd invoke "stateChange" event


    me.fireEvent('setfixvalue', me, header);
    Please Help.

  4. #4
    Sencha Premium Member
    Join Date
    Apr 2013
    Posts
    55
    Vote Rating
    1
    extjs.mscit is on a distinguished road

      0  

    Default Created new class, but does not working.

    Created new class, but does not working.


    Code:
    Ext.define('Ext.ux.grid.FilterHeaderColumnModel',{
            
        extend: 'Ext.grid.column.Column',
        
        alias: 'widget.fixvaluecolumn',
    
    // stateful: true,
    
        stateEvents : 'setfixvalue'
    
    });
    I also tried to set stateful : true, but that does not make any difference

    Note: i have used xtype: 'fixvaluecolumn' for each column config.

Thread Participants: 1

Tags for this Thread