Results 1 to 2 of 2

Thread: Getting started with scripting integration

  1. #1
    Junior Member
    Join Date
    Aug 2015

    Getting started with scripting integration

    I've installed Lianja and created a simple database app containing two tables, "Sites" and "Pages". I want to add a column to the Sites grid which would contain a button. When a user clicks on this button, I want it to run a PHP script, passing fields from the current Sites row to the script.

    This seems like it should be a simple thing, but I don't see how to add a button to a grid column, nor do I understand how to link the click action of that button to running a script. When the script runs, I want it to perform some action that updates the the Pages table.

  2. #2
    Senior Member
    Join Date
    Jul 2013
    Ontario, Canada
    Hello bkonia,

    Welcome to the forum.

    Please note that you cannot directly add values to a specific grid cell.
    You will need to update the database then you will need to refresh the section using Lianja.get("page1.section1").refresh()

    I have not added buttons to the grid and I'm not a PHP user although perhaps I can still help you.
    There are a few posts that discuss this topic. If you perform a search (top left) for 'hyperlink' or 'button', you may find some helpful posts.

    Some of the posts do discuss adding a button manually with code although it is more advanced techniques.

    Take a look at this thread.
    Grid column with command button

    There are a few things you will need to do (some of which can be done several different ways although I will provide one possibility).

    1. Click the 'Data' workspace icon located on the left side in the Lianja App Builder.
    2. Click your table name once.
    3. The middle section has an area for columns. Click the + sign at the bottom left of that section to add a column.
    4. Once the column is created, click the 'Pages' workspace icon on the left side.
    5. At the bottom of the page, click the 'Sections' icon and select 'Grid'.
    6. Drag and drop the table name onto the grid section.

    Now the grid is set up and ready to use.

    Double click the column header for the column you want to have the button.
    This should open the column attributes area.
    Set the button option to true.

    Once complete, double the the grid section header and look for 'Link Click'.
    If you click the '...' button, you will be able to add your own code.

    Here are a few more links that may help as well:
    Working with Files and File Systems in Lianja
    Linking a grid item to another page

    Last edited by CGibson; 2015-08-20 at 08:49.



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