1. #81
    Sencha Premium Member TexasSteve99's Avatar
    Join Date
    May 2011
    Location
    Arlington, TX
    Posts
    21
    Vote Rating
    1
    TexasSteve99 is on a distinguished road

      0  

    Default


    I just submitted a pull request to Loaine. Once its accepted, go for it!

    I will be posting a message about the changes after its accepted.

    Steve

    Quote Originally Posted by radtad View Post
    I was going to fix a couple of the following in regards to grid grouping:

    - colSpan is off by 1 (not sure if columns.length - 1 was the appropriate value)
    - groupName is not showing up

  2. #82
    Sencha Premium Member TexasSteve99's Avatar
    Join Date
    May 2011
    Location
    Arlington, TX
    Posts
    21
    Vote Rating
    1
    TexasSteve99 is on a distinguished road

      0  

    Default


    If your groupHeaderTpl has methods, the grid printer will not see those. You will need to fix the generatedBody() method to support it.


    The columns -1 colspan value is from a previous contributor.

    Thanks,

    Steve

  3. #83
    Sencha User
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    149
    Vote Rating
    1
    radtad is on a distinguished road

      0  

    Default


    Quote Originally Posted by TexasSteve99 View Post
    If your groupHeaderTpl has methods, the grid printer will not see those. You will need to fix the generatedBody() method to support it.


    The columns -1 colspan value is from a previous contributor.

    Thanks,

    Steve
    That's the section I was modifying . Just have to make sure I check for the groupHeaderTpl properly. As of right now, the feature.groupHeaderTpl.html default is '{groupName}: {name}' and doesn't return properly anyway. Nowhere is groupName set.

  4. #84
    Sencha Premium Member TexasSteve99's Avatar
    Join Date
    May 2011
    Location
    Arlington, TX
    Posts
    21
    Vote Rating
    1
    TexasSteve99 is on a distinguished road

      0  

    Default


    I'm looking into that right now. The only values the groupHeaderTpl sees in generateBody() is name and children. I'm working on an applyGroupTpl method to fix it so it will print any groupHeaderTpl.

    Steve

  5. #85
    Sencha Premium Member TexasSteve99's Avatar
    Join Date
    May 2011
    Location
    Arlington, TX
    Posts
    21
    Vote Rating
    1
    TexasSteve99 is on a distinguished road

      0  

    Default


    I've applied a fix for the columns -1 and groupHeaderTpl. It should be included in my pull request when Loiane approves it. If you want to try it out now, you can pull it from https://github.com/TexasSteve99/extj...ive/master.zip.

    Steve

    Quote Originally Posted by radtad View Post
    That's the section I was modifying . Just have to make sure I check for the groupHeaderTpl properly. As of right now, the feature.groupHeaderTpl.html default is '{groupName}: {name}' and doesn't return properly anyway. Nowhere is groupName set.

  6. #86
    Sencha Premium Member TexasSteve99's Avatar
    Join Date
    May 2011
    Location
    Arlington, TX
    Posts
    21
    Vote Rating
    1
    TexasSteve99 is on a distinguished road

      0  

    Default Grid Printer Updates

    Grid Printer Updates


    Good Morning Everyone,

    I have updated the Grid Printer on github with the following updates:
    1. Fixed the groupHeaderTpl handling to support all attributes except rows.
    2. Full XTemplate support for template columns and RowExpander.
    3. Styling via metadata object. The following attributes are supported:
      • align
      • tdCls
      • innerCls
      • style
      • tdAttr
      • tdCls
      • unselectableAttr
    4. Server generated summaries and groupingsummaries (remoteRoot).
    5. Added a rowexpander grid to example.html.
    For styling output with CSS classes, you must either:
    1. Copy your classes into the top of the print.css file or
    2. Supply a custom css file by setting a Ext.ux.grid.Printer.stylesheetPath prior to printing. I recommend you append the contents of print.css to this file.
    Server generated summaries (remoteRoot) for the summary feature is currently broken in ExtJS 4.2.1. The following override will fix it.

    Code:
    Ext.grid.feature.Summary.override({
        createSummaryRecord: function(view) {
            var columns = view.headerCt.getVisibleGridColumns(),
                info = {
                    records: view.store.getRange()
                },
                colCount = columns.length, i, column,
                summaryRecord = this.summaryRecord || (this.summaryRecord = new view.store.model(null, view.id + '-summary-record'));
    
            // Set the summary field values
            summaryRecord.beginEdit();
    
            if (this.remoteRoot) {
                if (view.store.proxy.reader.rawData) {
                    if (Ext.isArray(view.store.proxy.reader.rawData[this.remoteRoot]))
                        summaryRecord.set(view.store.proxy.reader.rawData[this.remoteRoot][0]);
                    else
                        summaryRecord.set(view.store.proxy.reader.rawData[this.remoteRoot]);
                }
            } else {
                for (i = 0; i < colCount; i++) {
                    column = columns[i];
    
                    // In summary records, if there's no dataIndex, then the value in regular rows must come from a renderer.
                    // We set the data value in using the column ID.
                    if (!column.dataIndex) {
                        column.dataIndex = column.id;
                    }
    
                    summaryRecord.set(column.dataIndex, this.getSummary(view.store, column.summaryType, column.dataIndex, info));
                } 
            }
    
            summaryRecord.endEdit(true);
            // It's not dirty
            summaryRecord.commit(true);
            summaryRecord.isSummary = true;
    
            return summaryRecord;
        }
    });
    You can download the new version from https://github.com/loiane/extjs4-ux-...ive/master.zip

    Let me know if you run into any issues.

    This will be my last update for a while. I have an urgent project that needs my attention.

    Thanks,

    Steve Ervin
    Last edited by TexasSteve99; 25 Oct 2013 at 5:17 AM. Reason: Typo

  7. #87
    Sencha User
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    149
    Vote Rating
    1
    radtad is on a distinguished road

      0  

    Default


    Quote Originally Posted by TexasSteve99 View Post
    Good Morning Everyone,

    You can download the new version from https://github.com/loiane/extjs4-ux-...ive/master.zip

    Let me know if you run into any issues.

    This will be my last update for a while. I have an urgent project that needs my attention.

    Thanks,

    Steve Ervin
    So far works great!

  8. #88
    Sencha User
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    149
    Vote Rating
    1
    radtad is on a distinguished road

      0  

    Default


    Looks like it breaks on xtype: 'actioncolumn'.

    Code:
    Error: Cannot read property 'disabled' of undefined
    I think some logic to skip this column needs to be added since there is no reason to print it that I can see. Changes in red below fixes the problem.

    Code:
                // remove columns that do not contain dataIndex
                // or dataIndex is empty.
                // for example: columns filter or columns button
                var clearColumns = [];
                Ext.each(
                    columns,
                    function (column) {
                        if ( column ) {
                            if ( !Ext.isEmpty(column.dataIndex) &&
                                 !column.hidden                 &&
                                 !isGrouped && 
                                 column.xtype !== 'actioncolumn')
                            {
                                clearColumns.push(column);
                            } else if ( column.xtype === 'rownumberer'){
                                if (!column.text) column.text = 'Row';
                                clearColumns.push(column);
                            } else if ( column.xtype === 'templatecolumn'){
                                clearColumns.push(column);
                            } else if ( isGrouped && 
                                          column.dataIndex !== groupField && 
                                          column.xtype !== 'actioncolumn') 
                            {
                                clearColumns.push(column);
                            }
                        }
                    }
                );
                columns = clearColumns;
    Last edited by radtad; 29 Oct 2013 at 11:26 AM. Reason: Missed a check for actioncolumn if not grouped

  9. #89
    Sencha User
    Join Date
    Feb 2013
    Location
    NZ
    Posts
    77
    Vote Rating
    0
    mazhar.shaikh is on a distinguished road

      0  

    Default Using Grid Printer Plugin after using grid.reconfigure in the controller.

    Using Grid Printer Plugin after using grid.reconfigure in the controller.


    Hi,

    I am using the Grid plugin and it works just fine.

    There's a slight problem, I am using
    Code:
    grid.reconfigure
    in my controller and modifying the columns that appear in the grid.
    But on clicking the Print button, the grid still prints all the columns that I placed on the view.

    Is there a way, I could print only the columns thats on the grid?

    Thanks

  10. #90
    Sencha Premium Member TexasSteve99's Avatar
    Join Date
    May 2011
    Location
    Arlington, TX
    Posts
    21
    Vote Rating
    1
    TexasSteve99 is on a distinguished road

      0  

    Default


    Quote Originally Posted by mazhar.shaikh View Post
    Hi,

    I am using the Grid plugin and it works just fine.

    There's a slight problem, I am using
    Code:
    grid.reconfigure
    in my controller and modifying the columns that appear in the grid.
    But on clicking the Print button, the grid still prints all the columns that I placed on the view.

    Is there a way, I could print only the columns thats on the grid?

    Thanks
    I got into making updates to Grid Printer because it wasn't supporting reconfigure under 4.2.1. It properly handles reconfigure in my code now. Could you let me know which version your using?

    Thanks,

    Steve