Announcement

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

    grid filter and setData

    <HTML><HEAD>
    <SCRIPT>var isomorphicDir="../isomorphic/";</SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Core.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Containers.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Grids.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Forms.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/skins/TreeFrog/load_skin.js></SCRIPT>
    </HEAD><BODY>
    <SCRIPT>
    isc.DataSource.create({
    ID:"fsEnumDataSource",
    fields:[
    {name:"c0", title:"c0", width:100, type:"text", showHover:true},
    {name:"c1", title:"c1", width:100, type:"text", showHover:true}
    ],
    clientOnly:true
    });

    isc.ListGrid.create({
    ID: "ctDisplayDataGrid",
    showFilterEditor: true,
    filterOnKeypress: true,
    canPickFields:false,
    width:300,
    autoFitFieldWidths:true,
    autoFitData:"horizontal",
    border:"1px solid red",
    autoFetchData:true,
    canReorderRecords: true,
    autoDraw:true,
    dataSource:"fsEnumDataSource"
    });


    var MAX_COL = 2;
    var MAX_ROW = 4;

    var data = Array.create();
    for ( r=0; r<MAX_ROW; r++){
    row = Array.create();
    for ( i=0; i<MAX_COL; i++){
    row["c"+i]="row"+r+"col"+i;
    }
    data.add(row);
    }

    ctDisplayDataGrid.setData(data);

    </SCRIPT>
    </BODY></HTML>
    Last edited by svonmiller; 8 Feb 2011, 14:39.

    #2
    Very close - now provide the generated data to the DataSource via the testData property (as shown here).

    Comment


      #3
      Thanks. That works.

      Comment

      Working...
      X