Results 1 to 9 of 9

Thread: Lianja.showPickList() in Lianja 6.3

  1. #1
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,781
    Blog Entries
    18

    Lianja.showPickList() in Lianja 6.3

    It has been a popular request to add support into Lianja for "pick lists" so in Lianja 6.3 I have implemented Lianja.showPickList().

    Code:
    Lianja.showPickList(
        "Select an Order",                         /* title */
        function(rowdata)                          /* onok */
        {
            // rowdata is an object with members for all columns in the active grid record 
            console.log(rowdata);
        },
        function()                                 /* oncancel */
        {
        },
        600,                                       /* width */
        600,                                       /* height */
        "southwind",                               /* database */
        "orders",                                  /* table */
        "",                                        /* filter */
        [                                          /* columns to display */
            {caption: 'CustomerID', controlsource: 'customerid', type: 'C', width: 100},
            {caption: 'OrderID', controlsource: 'orderid', type: 'C', width: 100},
            {caption: 'Order Date', controlsource: 'orderdate', type: 'D', width: 100},
            {caption: 'Required Date', controlsource: 'requireddate', type: 'D', width: 100},
            {caption: 'Shipped Date', controlsource: 'shippeddate', type: 'D', width: 100}
        ]
    );
    The onok callback is called if the user double clicks a row to select it. It is passed an object which contains members for all columns in the active record.

    See screenshots below.

    Name:  Screen Shot 2021-11-08 at 11.03.43 AM.jpg
Views: 111
Size:  62.0 KB

    You can search for text across the rows of the grid and a searchfilter is applied.

    Name:  Screen Shot 2021-11-08 at 11.04.05 AM.jpg
Views: 113
Size:  61.4 KB
    Last edited by barrymavin; 2021-11-08 at 05:25.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  2. #2
    Member
    Join Date
    Jan 2014
    Location
    Netherlands, Middelburg
    Posts
    34
    Hi Barry,

    maybe here also great if onok callback is called if the user presses <ENTER> and the oncancel it <ESC> is pressed, assuming the arrow keys can be used for navigation?

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    This great new feature are the top if you can add also query picker and sort option.. :-)

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,781
    Blog Entries
    18
    Hi Fabio

    The grid is sortable by clicking on the column headers. In desktop the query picker is built into the grid but not in the web. Maybe later not in 6.3. The search bar satisfies most requirements.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,781
    Blog Entries
    18
    Hi Leon,

    In desktop apps that is what happens.

    If you are using Lianja.showPickList() in LianjaScript/VFP it operates slightly differently.

    1. It is modal
    2. No onok or oncanel callbacks are needed. These are only for web based javascript apps.
    3. It returns a JSON encoded string of the selected record. You can decode this into an object using json_decode() and reference the fields of the record.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  6. #6
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    excellent as always!

    Lasagna for Barry!

  7. #7
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Hi Barry
    what would be the syntax for a Lianja script?

    thanks
    Fabio

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,781
    Blog Entries
    18
    Hi Fabio

    Code:
    jsonresult = Lianja.showPickList( ;
        "Select an Order",  ;               
        600,  ;                              
        600,  ;                                
        "southwind",  ;                    
        "orders", ;                           
        "", ;                               
        “Caption:controlsource:type:width, …”  ;
    )
    
    if len(jsonresult) > 0
        result = json_decode( jsonresult )
    endif
    Notice how the onok and onsuccess callbacks are not needed in LianjaScript as it’s a modal dialog. The column definitions are specified as a comma separated string. The result is a JSON string.
    Last edited by barrymavin; 2021-11-14 at 09:58.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  9. #9
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    many thanks

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