Announcement

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

    How to find listGrid object using Id

    Hello,

    I am fetching data from server only when user request. And ID of grid is, dynamic. User can create as much list as they want.

    isc.ListGrid.create({
    ID: newID+'_user_created',
    width:"100%", height:"100%",
    alternateRecordStyles:true,
    dataSource: myDataSource
    });

    No I want to find ListGrid object and fetchData.

    I tried
    (newID+'_user_created').fetchData(); // but it raise error.
    ListGrid[newID+'_user_created'].fetchData(); // undefined

    How can I retrieve it by Id??

    Thanking you.

    #2
    as long as you know that ID is a global javascript identifier
    http://www-demos.smartclient.com/sma...html#search=id
    this is not a SmartClient problem, but a javascript question

    try:
    window[newID+'_user_created'].fetchData();

    Comment


      #3
      Thank you @Claudiobosticco.

      That works.

      Comment

      Working...
      X