jQWidgets Forums

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts

  • GildoMat59
    Participant

    Hi Peter

    Thanks for your answer, I red the doc about the TreeGrid and it is write that I cannot target the php modeule on my server, so I cannot export data if the system is on intranet. that is true?

    Regards
    Gildo


    GildoMat59
    Participant

    Hi Peter,

    I have to use the Grid exportdata, but it will be used in intranet, where your server is not visible. for this reason I had to use the ‘save-file.php’ on my server. the internal directory is ‘php\save-file.php’.

    I red the documentation:

    Export(requires jqxdata.export.js and jqxgrid.export.js)
    exportdata Method
    Exports all rows loaded within the Grid to Excel, XML, CSV, TSV, HTML or JSON.

    The first parameter of the export method determines the export’s type – ‘xls’, ‘xml’, ‘html’, ‘json’, ‘pdf’, ‘tsv’ or ‘csv’.
    The second parameter is the file’s name. If you don’t provide a file name, the Grid will export the data to a local variable.
    For example:
    var data = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘json’);

    The third parameter is optional and determines whether to export the column’s header or not. Acceptable values are – true and false. By default, the exporter exports the columns header.
    The fourth parameter is optional and determines the array of rows to be exported. By default all rows are exported. Set null, if you want all rows to be exported.
    The fifth parameter is optional and determines whether to export hidden columns. Acceptable values are – true and false. By default, the exporter does not export the hidden columns.
    The sixth parameter is optional and determines the url of the export server. By default, the exporter is hosted on a jQWidgets server.
    The last parameter is optional and determines the char set.
    Code example

    Invoke the exportdata method.

    $(“#jqxGrid”).jqxGrid(‘exportdata’, ‘json’, ‘jqxGrid’);

    Code example with custom URL parameter

    $(“#jqxGrid”).jqxGrid(‘exportdata’, ‘json’, ‘jqxGrid’, true, null, true, http://www.myserver.com/save-file.php);

    so I tryed on localhost but dosent works. the call is this:

    $(“#jqxTreeML”).jqxTreeGrid(‘exportdata’, ‘xls’,’myfile’,true,null,true, http://localhost:90/MyLMS_Compact/php/save-file.php );

    but I had this error:

    Uncaught SyntaxError: missing ) after argument list

    Also with this code:

    $(“#jqxTreeML”).jqxTreeGrid(‘exportdata’, ‘xls’,’myfile’,true,null,true, “http://localhost:90/MyLMS_Compact/php/save-file.php” );

    I have this error:

    Uncaught jqxCore: Invalid parameter ‘[exportdata, xls, myfile, true, {}, true, http://localhost:90/MyLMS_Compact/php/save-file.php%5D‘ does not exist.

    Do you have any suggestion?
    Thanks
    Gildo


    GildoMat59
    Participant

    Hi Peter
    As you know I’m a rookie on your widgets /Javascript and any of your suggestion are wellcome. One the text in my last post (sorry for my bad english), there is a mistake, about the treegrid, it is into a div owned by a tabs.
    About the Grid in Horz splitter the analisys is correct. In any way, I will reread the technical docs and I hope I will find a right way to solve my troubles.
    thanks


    GildoMat59
    Participant

    I understand that the problem is the combination of splitters Tabs and TreeGrid. In practice, when I create the TreeGrid, the height property setted to 100%, the space in the splitter/Tabs is not dimensioned and then assigns the TreeGrid height = 0 and it is not possible see the Items. I solved it by creating the treegrid just before filling it, then in the page already created and sized. Then I have calculated the height of the space to be occupied with JQuery, and I have inserted the value in the TreeGrid height property . This solution is only valid for the vertical splitter, I found I had a similar trouble with the Grid at the bottom of the page, where I added a toolbar and next the Grid (see figures above in the first post). Here the splitter is horizontal, and I always have a hidden part of the grid. For now I still have not addressed the problem, but it is difficult to solve as to keep the grid dimensioned by the displacement of the splitter the height property must be 100% but this does not take into account the toolbar that moves the grid below. By calculating the space occupied by the toolbar is not working. I’ll see if I can find a solution..

    Thanks


    GildoMat59
    Participant

    Hi Peter, I made this test, I have initialized the Height property with a value (500px) and all works well, unfortunately I have to fill exactly the splitter space and the right value, for me, is 100%…. Now I will go to read the pages you suggest me.
    thanks a lot!


    GildoMat59
    Participant

    Hi! Peter,

    For me is clear that I have to set the Height propert with percentage or value. An I have supposed that if The property is 100% automatically will be visualized the vertical scrollbar. Unfortunately, if I set the Height property with the 100% value the result is like the second picture…. my code is this:

    
    				var generateTasks = function (expandedRecord) {
    					if (expandedRecord===null)
    						return StrutturaTecnica.GetTreeBindData();
    					return expandedRecord.items;
    					};
    
    				$(Posto).jqxTreeGrid(
    					{
    					width			: '100%',
    					//height		: '100%', 
    					pageable: false,
    					altRows: true,
    					icons: true,
    					autoRowHeight: false,
    					virtualModeCreateRecords: function(expandedRecord, done){   		
    						var src=StrutturaTecnica.GetTreeSourceStruct(generateTasks(expandedRecord));
    						var dataAdapter = new $.jqx.dataAdapter(src, {
    							loadComplete: function () {
    								done(dataAdapter.records);
    								}
    							});
    						dataAdapter.dataBind();
    						},
    					virtualModeRecordCreating: function(record){   		
    						if (record.items === undefined || !record.items.length) {
    							record.leaf = true;
    							}
    						},
    					theme : defs.Tema_jqx,
    					columns: [
    						{ text: 'Struttura gerarchica', dataField: "label", align: 'center', width: '100%' },
    						]
    					});
    

    As you can see at the moment the height property is commented, in this way I can see the Items (picture one), if I uncomment the line nothing is displayed picture 2! In any case I will reread the documentation. Thanks for your suggestion!

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