Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Rendering Listgrid is slow with around 900 records

    Hello there,

    I am using a licence copy of SmartGWT Power 3 and testing on Firefox browser version 26.
    I am trying to load data from multiple tables(5 tables) into a Listgrid which has around 900 records. But when I try to scroll the records in the browser it is slow to render and show the data,which is annoying to the users.

    Below is my client side code.

    Code:
     
    public class CusNeighbourGroupView extends VLayout implements CusNeighbourGroup
    {
        public CusNeighbourGroupView()
        {
            intialise();
        }
    
        public void intialise()
        {
            ListGridField province = new ListGridField("provincename");
            ListGridField capital = new ListGridField("capital");
            ListGridField code = new ListGridField("code");
            ListGridField telcode = new ListGridField("telcode");
            ListGridField county = new ListGridField("countyname");
            ListGridField district = new ListGridField("district");
            ListGridField city = new ListGridField("city");
            ListGridField zone = new ListGridField("zone");
            ListGridField neigbhour = new ListGridField("neigbhour");
            ListGridField taxcodecity = new ListGridField("taxcodecity");
            ListGridField fdocode = new ListGridField("fdocode");
            ListGridField countCustomer = new ListGridField("countCustomer");
    
            final ListGrid listGrid = new ListGrid();
            listGrid.setWidth100();
            listGrid.setHeight100();
            
            
            // listGrid.setShowAllRecords(true);
    
            listGrid.setDataSource(DataSource.get("neighbourDS_1"));        
            listGrid.setAutoFetchData(true);
            // listGrid.setCanMultiSort(true);
    
            listGrid.setFields(province, capital, code, telcode, /*taxcode,*/ county, district, city, zone, neigbhour, taxcodecity, fdocode, countCustomer);
            
            setWidth100();
            setHeight100();
            addMember(listGrid);
        }
    This is the datasource which I pass to my listgrid

    Code:
    <DataSource ID="neighbourDS_1" serverType="sql" tableName="neighbourhood" inheritsFrom="neighbourDS">
    	<fields>
    		<field name="provincename" includeFrom="provinceDS.provincename" />
    		<field name="capital" includeFrom="provinceDS.capital" />
    		<field name="code" includeFrom="provinceDS.code" />
    		<field name="telcode" includeFrom="provinceDS.telcode" />
    		<field name="countyname" includeFrom="countyDS.countyname" />
    		<field name="district" includeFrom="districtDS.districtname" />
    		<field name="city" includeFrom="cityDS.cityname" />
    		<field name="taxcodecity" includeFrom="cityDS.taxcodecity" />
    		<field name="fdocode" includeFrom="cityDS.fdocode" />
    		<field name="zone" includeFrom="zoneDS.zone" />
    	</fields>
    </DataSource>

    Below is the SQL SmartWT generates for my datasource

    Code:
     SELECT
        *
    FROM
        (
            SELECT
                *,
                ROW_NUMBER() OVER (ORDER BY id) AS rowID
            FROM
                (
                    SELECT
                        TOP 100 PERCENT                neighbourhood.id,
                        neighbourhood.alternateName AS neigbhour,
                        province.provincename,
                        province.capital,
                        province.code,
                        province.telcode,
                        county.countyname,
                        district.districtname AS district,
                        city.cityname         AS city,
                        city.taxcode          AS taxcodecity,
                        city.fdocode,
                        zone.name AS zone
                    FROM
                        city,
                        neighbourhood,
                        province,
                        county,
                        district,
                        zone
                    WHERE
                        (
                            '1'='1')
                    AND neighbourhood.zoneId = zone.id
                    AND zone.cityId = city.id
                    AND city.districtID = district.id
                    AND district.countyID = county.id
                    AND county.provinceID = province.id) x) y
    WHERE
        y.rowID BETWEEN 1 AND 75

    #2
    Hi zaj,

    that should not be slow in compiled mode in a recent browser with the correct DOCTYPE set, IMHO.
    So what's the exact version of your 3.0p, what mode do you refer to and what does your main html look like?

    Best regards,
    Blama

    Comment


      #3
      Much much larger numbers of records are handled by samples shown in the Showcase with no slowness at all. See the FAQ for common ways in which you might be creating slowness.
      Last edited by Isomorphic; 16 Dec 2014, 01:15.

      Comment


        #4
        Hi Blama,

        Thanks for your feedback. For this test purpose I am using the SmartClient Version: v8.3p_2014-11-22/PowerEdition Deployment (built 2014-11-22)
        and my html file is set to

        <!DOCTYPE html>

        Comment


          #5
          OK, then stick to Isomorphic's tip. My last guess would be testing in GWT Development Mode instead of compiled application. Same problem in an other browser (not IE11, AFAIR not supported in 3.1p)?

          Comment

          Working...
          X