[CLOSED] GridView GetRowClass and RowExpander conflict?

  1. #1

    [CLOSED] GridView GetRowClass and RowExpander conflict?

    I have a grid that has uses GetRowClass in a GridView to set the CSS class on a row. I've since added a RowExpander and the GetRowClass function now never gets called. If I remove the RowExpander GetRowClass starts working again.

    Is there a way to resolve this?

    Regards,
    Ben

  2. #2

    RE: [CLOSED] GridView GetRowClass and RowExpander conflict?

    Hi,

    You cannot use RowExpander and GetRowClass at one time because RowExpander defines own GetRowClass function which will override grid's GetRowClass function (otherwise you can get a conflict)
  3. #3

    RE: [CLOSED] GridView GetRowClass and RowExpander conflict?



    Thanks. Is it possible to override this? I've had a look, would createSequence or createInterceptor help?

    Something like:

    function newFunctionName()
    {
        // Some logic
        return "some-css-class-name";
    }
    
    var gridView = grid.getView();
    
    
    gridView.getRowClass = newFunctionName.createSequence(gridView.getRowClass);
    Ben
  4. #4

    RE: [CLOSED] GridView GetRowClass and RowExpander conflict?

    Hi,

    Yes, you can use createSequence/createInterceptor but you can get unxpected result.


    <Render Handler="this.getView().getRowClass = this.getView().getRowClass.createSequence(myGetRowClassFunc, this.getView());" />
  5. #5

    RE: [CLOSED] GridView GetRowClass and RowExpander conflict?



    Thanks, I'll have a play.

    Ben
  6. #6

    RE: [CLOSED] GridView GetRowClass and RowExpander conflict?

    I had this working OK but since the upgrade to 1.0 it's not been playing ball.

    Any suggestions on how to get this working with v1?


    Thanks,

    Ben
  7. #7

    RE: [CLOSED] GridView GetRowClass and RowExpander conflict?

    Hi,

    Please demonstrate how the things are configured (test example)
  8. #8

    Any update on this?

    Any update on this?
  9. #9
    Now there is the same situation.

    You can override the RowExpander's getRowClass method, but be careful to get unexpected result.

    Here is the original code of the getRowClass method with a possibility to override.

    Example
    <ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
    <script type="text/javascript">
        Ext.grid.RowExpander.override({
            getRowClass : function (record, rowIndex, p, ds) {
                p.cols = p.cols - 1;
                var content = this.bodyContent[record.id];
            
                if (!content && !this.lazyRender) {
                    content = this.getBodyContent(record, rowIndex);
                }
            
                if (content) {
                    p.body = content;
                }
            
                return this.state[record.id] ? "x-grid3-row-expanded" : "x-grid3-row-collapsed";
            }
        });
    </script>

Similar Threads

  1. Replies: 2
    Last Post: Nov 04, 2011, 6:06 PM
  2. [CLOSED] GridView GetRowClass: not working with RowExpander plugin
    By capecod in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 05, 2010, 1:44 PM
  3. [CLOSED] [1.0] Does GetRowClass still work the same in 1.0?
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 05, 2010, 1:14 PM
  4. [CLOSED] GridView GetRowClass Args Property
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 07, 2008, 3:44 PM

Posting Permissions