jQWidgets Forums

jQuery UI Widgets Forums Grid Exporting columns to Excel generated by cellsrenderer

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 12 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • jmarais
    Participant

    I do have the names and surnames of customers as separate columns in my database and I display them in a single column in the grid. I achieve that by using a cellsrenederer function:

    	    var namerenderer = function (row, datafield, value) {
    var records = dataAdapter.records;
    var record = records[row];
    return value+' '+record.surname;
    };

    where the datafield that I use is name, which is the datafield from the database that I use.

    When I export the data to Excel it export only the name and not the value generated by cellsrenderer. I assume that the export function use the imported datafields and not the ones generated by something like the cellsrenderer function.

    Is there a way to overcome this so that I can export the name and surname as a single datafield?


    jmarais
    Participant

    OK, I used the concat statement in the mysql query to combine the name and surname into a single datafield, which resolves the problem in this specific instance but I do have more complex cases where I use the cellsrenderer function to produce the required outcome.

    Is there a way of exporting the result of the cellsrenderer function or do I have to rake care of the outcome before I import them with the dataAdapter?


    Peter Stoev
    Keymaster

    Hi Johan,

    The exporting functionality exports the rows that come from the dataAdapter i.e what the getrows method of jqxGrid returns as a result. It will not export custom data or data generated on demand by the cellsrenderer.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.