Results 1 to 2 of 2

Thread: From a button in a canvas section, how can I activate a grid in a grid section?

  1. #1

    From a button in a canvas section, how can I activate a grid in a grid section?

    From a button in a canvas section, how can I activate a grid in a grid section?

  2. #2
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,259
    This functionality has been added into beta5 Refresh 2.

    Note also that you can use the addItems() method to populate a grid from an array. (See below). Also notice how in Lianja you can create arrays in VFP scripting using the { .... } constructs (same as PHP and JavaScript).

    ////////////////////////////////////////////////////////////////
    // Event delegate for 'click' event -- populates the grid using SQL
    proc page1_section2_field1_click()
    mygrid = Lianja.findElementByID("mygrid").grid
    mygrid.clear
    mygrid.addItems("select * from southwind!example")
    endproc

    ////////////////////////////////////////////////////////////////
    // Event delegate for 'click' event -- clears the grid
    proc page1_section2_field2_click()
    mygrid = Lianja.findElementByID("mygrid").grid
    mygrid.clear
    endproc

    ////////////////////////////////////////////////////////////////
    // Event delegate for 'click' event -- populates a grid from an array
    proc page1_section2_field3_click()
    mygrid = Lianja.findElementByID("mygrid").grid
    mygrid.clear
    myarray = { {"one", "two"}, {"Three", "Four"} }
    myheader = { "Name", "Value" }
    mywidths = { 100, 200 }
    mygrid.addItems(myarray, myheader, mywidths)
    endproc

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us