jQuery UI Widgets Forums TreeGrid Can't read my .CVS file

Tagged: , ,

This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 9 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Can't read my .CVS file #74455

    Lulu
    Participant

    Hi,

    I have the following data in data.cvs file

    1 18 v9.80 CQ 123 Pass In Progress John Smith Blended_101 12345 7/7/2015
    2 7 v9.81 CQ 124 Fail In Progress John Smith Blended_102 343 7/8/2015
    3 14 v9.82 CQ 125 Fail In Progress John Smith Blended_103 234234 7/9/2015
    4 3 v9.83 CQ 126 Fail In Progress John Smith Blended_104 23445345 7/10/2015
    6 267 v9.84 CQ 127 Fail In Progress John Smith Blended_105 5435 7/11/2015
    7 112 v9.85 CQ 128 Fail In Progress John Smith Blended_106 43 7/12/2015
    9 23 v9.86 CQ 129 Fail In Progress John Smith Blended_107 345 7/13/2015
    10 189 v9.87 CQ 130 Fail In Progress John Smith Blended_108 57 7/14/2015
    11 3 v9.88 CQ 131 Fail In Progress John Smith Blended_109 768 7/15/2015
    12 189 v9.89 CQ 132 Pass In Progress John Smith Blended_110 897 7/16/2015
    13 3 v9.90 CQ 133 Pass In Progress John Smith Blended_111 678 7/17/2015
    14 112 v9.91 CQ 134 Pass In Progress John Smith Blended_112 8979 7/18/2015
    15 189 v9.92 CQ 135 Pass In Progress John Smith Blended_113 678768 7/19/2015
    16 23 v9.93 CQ 136 Pass In Progress John Smith Blended_114 567 7/20/2015
    17 189 v9.94 CQ 137 Pass In Progress John Smith Blended_115 57567 7/21/2015
    18 23 v9.95 CQ 138 Pass In Progress John Smith Blended_116 56756 7/22/2015
    19 189 v9.96 CQ 139 Pass In Progress John Smith Blended_117 576 7/23/2015
    20 23 v9.97 CQ 140 Fail In Progress John Smith Blended_118 5789 7/24/2015
    21 189 v9.98 CQ 141 Fail In Progress John Smith Blended_119 567 7/25/2015
    22 177 v9.99 CQ 142 Fail In Progress John Smith Blended_120 98 7/26/2015
    23 112 v9.100 CQ 143 Fail In Progress John Smith Blended_121 78 7/27/2015
    24 201 v9.101 CQ 144 Fail In Progress John Smith Blended_122 76868 7/28/2015

    I don’t why my tree grid is not importing my data.cvs file
    I don’t know what I am doing wrong.

    please help me.

    This is my grid tree file

    <!DOCTYPE html>
    <html lang=”en”>
    <head>
    <title id=”Description”>Blaze Rule.</title>
    <link rel=”stylesheet” href=”CSS/jqx.base.css” type=”text/css” />

    <script type=”text/javascript” src=”Script/Grid/jquery-1.10.2.min.js”></script>
    <script type=”text/javascript” src=”Script/Grid/jqxcore.js”></script>
    <script type=”text/javascript” src=”Script/Grid/jqxdata.js”></script>
    <script type=”text/javascript” src=”Script/Grid/jqxdata.export.js”></script>
    <script type=”text/javascript” src=”Script/Grid/jqxbuttons.js”></script>
    <script type=”text/javascript” src=”Script/Grid/jqxscrollbar.js”></script>
    <script type=”text/javascript” src=”Script/Grid/jqxdatatable.js”></script>
    <script type=”text/javascript” src=”Script/Grid/jqxtreegrid.js”></script>
    <script type=”text/javascript” src=”Script/Grid/jqxdropdownlist.js”></script>
    <script type=”text/javascript” src=”Script/Grid/jqxlistbox.js”></script>
    <script type=”text/javascript” src=”Script/Grid/demos.js”></script>

    <script type=”text/javascript”>
    $(document).ready(function () {

    // prepare the data
    var source =
    {
    dataType: “cvs”,
    dataFields: [
    { name: ‘RuleID’, type: ‘number’ },
    { name: ‘RuleSubID’, type: ‘number’ },
    { name: ‘VERSION’, type: ‘string’ },
    { name: ‘CQTICKETNUMBER’, type: ‘string’ },
    { name: ‘PassFail’, type: ‘string’ },
    { name: ‘RULESTATUS’, type: ‘string’ },
    { name: ‘ModifiedBy’, type: ‘string’ },
    { name: ‘RULEIDENTIFIER’, type: ‘string’ },
    { name: ‘CASEID’, type: ‘string’ },
    { name: ‘CreatedDate’, type: ‘date’ }
    ],
    hierarchy:
    {
    keyDataField: { name: ‘RuleID’ },
    parentDataField: { name: ‘RuleSubID’ }
    },
    id: ‘RuleID’,
    url: ‘Data.cvs’
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    // create Tree Grid
    $(“#treeGrid”).jqxTreeGrid(
    {
    width: 850,
    source: dataAdapter,
    pageable: true,
    columnsResize: true,
    sortable: true,
    filterable: true,
    filterMode: ‘simple’,
    pagerMode: ‘advanced’,
    pageSizeMode: ‘root’,
    pageSize: 10,
    theme: ‘energyblue’,

    pageSizeOptions: [‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ’10’],

    ready: function()
    {
    //$(“#treeGrid”).jqxTreeGrid(‘expandRow’, 32);
    },
    columns: [
    { text: ‘VERSION’, dataField: ‘VERSION’, pinned: true, minWidth: 100, width: 200 },
    { text: ‘CQTICKETNUMBER’, dataField: ‘CQTICKETNUMBER’, width: 200 },
    { text: ‘PassFail’, dataField: ‘PassFail’, width: 150 },
    { text: ‘RULESTATUS’, dataField: ‘RULESTATUS’, width: 300 },
    { text: ‘ModifiedBy’, dataField: ‘ModifiedBy’, width: 300 },
    { text: ‘RULEIDENTIFIER’, dataField: ‘RULEIDENTIFIER’, width: 300 },
    { text: ‘CASEID’, dataField: ‘CASEID’, width: 300 },
    { text: ‘CreatedDate’, CreatedDate: ‘CreatedDate’, cellsFormat: ‘d’, width: 120 }
    ]
    });

    $(‘#Expandbutton’).click(function () {
    $(“#treeGrid”).jqxTreeGrid(‘expandAll’)
    });

    $(‘#Collapsebutton’).click(function () {
    $(“#treeGrid”).jqxTreeGrid(‘collapseAll’)
    });

    // Export data
    //$(“#excelExport”).jqxButton();
    $(“#excelExport”).click(function () {
    $(“#treeGrid”).jqxTreeGrid(‘expandAll’)
    //var rows = $(“#treeGrid”).jqxTreeGrid(‘getRows’);
    // for (var i = 0; i < rows.length; i++) {
    // var key = $(“#treeGrid”).jqxTreeGrid(‘getKey’, rows[i]);
    // $(“#treeGrid”).jqxTreeGrid(‘expandRow’, key);
    // }
    $(“#treeGrid”).jqxTreeGrid(‘exportData’, ‘xls’);
    $(“#treeGrid”).jqxTreeGrid(‘collapseAll’)
    //$(“#treeGrid”).jqxTreeGrid(‘expandRow’, 32);
    });

    });

    </script>
    </head>
    <body class=’default’>
    <div id=”treeGrid”>
    </div>

    <table>

    <tr>
    <td>
    <input type=”button” value=”Export to Excel” id=’excelExport’ style=”cursor:pointer;” class=”jqx-rc-all jqx-button jqx-widget jqx-fill-state-normal” />
    </td>
    <td>
    <input type=”button” style=”margin: 10px; cursor:pointer;” id=”Collapsebutton” value=”Collapse all items” class=”jqx-rc-all jqx-button jqx-widget jqx-fill-state-normal” />
    </td>
    <td>
    <input type=”button” style=”margin: 10px; cursor:pointer;” id=”Expandbutton” value=”Expand all items” class=”jqx-rc-all jqx-button jqx-widget jqx-fill-state-normal” />
    </td>
    </tr>

    </table>

    </body>
    </html>

    Can't read my .CVS file #74459

    ivailo
    Participant

    Hi Lulu,

    CSV means Comma-separated values. So you have to separate the values with commas.
    Instead you uses TSV (Tab-separated values).

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.