jQWidgets Forums

jQuery UI Widgets Forums Grid Grid export displayfields instead of datafields

This topic contains 4 replies, has 3 voices, and was last updated by  Dimitar 10 years, 8 months ago.

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

  • vincentvega
    Member

    jqxGrid newbie.

    I have a grid with 8 columns, several of which are selectable dropdown lists ( name value pairs where names are displayed yet values are sent behind the scenes upon selection). Both displayfields and datafields are specified on the columns in this grid. Some columns have the displayfield and datafields set to the same value, others are set to different values depending upon what is needed to be. I’ve also implemented an export to html feature as per the demo on the jqWidgets site.
    The issue I am having is that upon selecting the export option (clicking an export/print button). I noticed that the values shown in the html export for the columns where the displayfields and datafields differ, are always the datafields and not the displayfields as I would like.
    Is there any way to force the export grid feature to show the displayfields instead of the datafields? I’ve searched the API documentation to no avail.

    Thanks.


    Dimitar
    Participant

    Hello vincentvega,

    The exportdata function exports only the column datafield and not its displayfield. This is the method’s normal behaviour.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    mario santanche
    Participant

    Hi Dimitar,

    I would like to export the datafield, but the function exports the displayfield!
    Here is my code:

          $("#jqxgrid").jqxGrid(
                {
                    width: 1200,
                    source: gridAdapter,
                    selectionmode: 'singlecell',
                    autoheight: true,
                    editable: true,
                    theme: theme,
                    columns: [
                     
                    { text: 'titolo', columntype: 'textbox', filtertype: 'textbox', datafield: 'titolo', width: 480 },
                    { text: 'editore', datafield: 'editore', width: 241},
                    { text: 'issn',  datafield: 'ISSN_PR', width: 83},
                    { text: 'e-issn', filtertype: 'textbox', datafield: 'ISSN_OL', width: 83 },
                    { text: 'altro-issn',  datafield: 'ISSN_AL', width: 83 },
                    { text: 'idRivista',  datafield: 'idrivista', width: 83 },
                    { text: 'IdPubblicazione', datafield: 'IdPubblicazione', width: 83 },
                           
                    {text: 'Fornitore', datafield: 'Idfornitore', displayfield: 'Fornitore', columntype: 'combobox', width: 200,
                            createeditor: function (row, value, editor) {
                                editor.jqxComboBox({ source: formAdapter, displayMember: 'Fornitore', valueMember: 'Idfornitore', width: '200px' });
                                
                            	}
                    	      },
                    	      
                    	      
                    	]
                 });
       
          
          
          
          
          
                $('#jqxgrid').on('bindingcomplete', function (event) {
                $('#jqxgrid').jqxGrid('hidecolumn', 'IdPubblicazione'); 
                  $('#jqxgrid').jqxGrid('hidecolumn', 'idrivista'); 
                  });
                
               $('#jqxButtonEdi').on('click', function () { 
            var data=$("#jqxgrid").jqxGrid('exportdata', 'json', 'esporta', true, null, true, 'http://.../aTodb.php');   
               });            
    
    

    I haven’t got the ID, I have the displayfield…
    Thanks,
    Mario


    mario santanche
    Participant

    I use jqwidget 3.3.0


    Dimitar
    Participant

    Hello mario santanche,

    Previous behaviour was fixed and the grid now exports the displayfield. This is the intended functionality. Unfortunately, there is no way to export the datafield.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.