EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: ClSoft on April 12, 2013, 01:31:03 AM



Title: Read JSON data
Post by: ClSoft on April 12, 2013, 01:31:03 AM
Hi all
I have treegrid with about 400 records. I can not use pagination.
Preparing of JSON file take about 1 sec, but displaying of data take about 20 seconds.
Each record have about 10 columns.
I'm using i5 processor with 8 GB of RAM.
Is that OK or it should display data faster?
Thanks.


Title: Re: Read JSON data
Post by: stworthy on April 12, 2013, 03:10:21 AM
How do you define the treegrid component? Providing a simple example may be appropriate.


Title: Re: Read JSON data
Post by: ClSoft on April 12, 2013, 03:29:48 AM
Hello
here is declaration of treegrid:
Code:
  <table id="members_tree" class="easyui-treegrid" toolbar="#tb" fit="true" fitcolumns="true" rownumbers="true" url="json/members_tree.json" idField="select_id" treeField="firstlastname" 
    data-options="onClickRow:onClickMemberTreeRow,onLoadSuccess:onLoadSuccessMembers">
<thead>
<tr>
  <th field="select_id" hidden="true"></th>
  <th field="id" hidden="true"></th>
  <th field="firstlastname" width="600%">First and Last name</th>   
  <th field="email" width="100%">Email</th>     
  <th field="phone" width="100%">Phone</th>   
  <!--  <th field="cell" width="100%">Cell phone</th>   -->
  <th field="entrydate" width="100%">Entry date</th>   
  <th field="birthdate" width="100%">Date Of Birth</th>   
  <th field="note" width="100%">Note</th>   
</tr>
</thead>
  </table>

Thank you!


Title: Re: Read JSON data
Post by: ClSoft on April 12, 2013, 04:33:58 AM
Here is complete example but without /scripts/jquery.easyui.min.js (because of 128 KB size limit).
Thanks.


Title: Re: Read JSON data
Post by: ClSoft on April 12, 2013, 06:35:38 AM
Update:
attached is new tree.htm (old have wrong table declaration, but loading time is same)


Title: Re: Read JSON data
Post by: stworthy on April 12, 2013, 07:42:43 AM
Please try to use the treegrid definition below. It runs quickly in chrome,firefox and ie.
Code:
    <table title="Folder Browser" class="easyui-treegrid" fit="true" fitcolumns="true"  
            data-options=" 
                url: 'members_tree.json', 
                idField: 'id', 
                treeField: 'firstlastname' 
            "> 
        <thead> 
          <tr>
            <th field="firstlastname" width="600%">First and Last name</th>   
            <th field="email" width="100%">Email</th>     
            <th field="phone" width="100%">Phone</th>   
            <th field="entrydate" width="100%">Entry date</th>   
            <th field="birthdate" width="100%">Date Of Birth</th>   
            <th field="note" width="100%">Note</th>   
          </tr>
        </thead> 
    </table> 


Title: Re: Read JSON data
Post by: ClSoft on April 12, 2013, 08:41:22 AM
It works light fast!
Thanks man.