Announcement

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

    ListGrid.createRecordComponent is causing a performance hit.

    1. Smartclient isc_version=v9.0p_2013-11-03 Power Edition

    2. IE9



    6. if((this.getFieldName(colNum) === "status") ){
    var rowNum = processList.getRecordIndex(record);
    return createStatusChangeButtons(record.status,rowNum);
    }
    function createStatusChangeButtons(status,rowNum){
    var statusLayout = isc.HLayout.create({
    ID:"statusBtnLayout_"+rowNum,
    width:"110",
    height:"25",
    membersMargin: 5,
    backgroundColor: "#ECE9D8",
    members:[]
    });
    var btn1Button = isc.Button.create({name:"btn1"+rowNum});
    var btn2Button = isc.Button.create({name:"btn2"+rowNum});
    var btn3Button = isc.Button.create({name:"btn3"+rowNum});
    var btn4Button = isc.Button.create({name:"btn4"+rowNum});
    statusLayout.addMember(btn1Button);
    statusLayout.addMember(btn2Button);
    statusLayout.addMember(btn3Button);
    statusLayout.addMember(btn4Button);
    return statusLayout;
    }


    This code is what is taking 4 seconds when there are ~800 rows returned for the ListGrid, and when scrolling it causes scroll lag and jumpiness . Need help with ideas on how to add 4 buttons to a ListGridRecord cell for every Record.

    #2
    Record components in large grids can start to cause some performance degredation due to the fact that you're potentially creating very large number of components in at once in an area that needs to be quite responsive.

    Some general tips:
    - Firstly, consider whether it makes sense to use embedded record-components at all. For simple button-like interfaces it may be less heavyweight to make use of icons or similar.
    - Secondly, take a look at the recordComponentPoolingMode documentation. By using the "recycle" approach, the listGrid will create as many components as it needs to display at one time, then as the user scrolls the grid, recordComponents which have been scrolled out of view will be re-used and applied to new cells. This will vastly improve performance and reduce application memory usage (you'll no longer be creating a new component for every cell in the grid).

    - Lastly - any new development should always be done against the lastest version of SmartClient. If upgrading to 10.0 is an option for you, we'd recommend that, but if not, at a minimum we'd recommend you move to 9.1 and pick up the latest nightly build from that branch. It may not impact this specific issue, but ensures you will have the latest feature set and will not be hitting any already-solved bugs.

    Regards
    Isomorphic Software

    Comment

    Working...
    X