Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: More controls in the grid

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

    More controls in the grid

    Good morning everyone.
    In planning the development of my application, I wanted to know if it is planned to introduce more controls in the grid.
    Having the opportunity to work on the grids, rather than individual records is very convenient, but, in my opinion, it would be useful to have all the controls available on FormItem standard:
    I refer in particular to:
    tooltip
    custom attribute
    Mandatori input
    change delegated
    etc ..

    the top would be if you could put the FormItem direttaemnte grid, as in VFP.

    Thanks
    Fabio

  2. #2
    Fabio,

    You can add whatever control you want in the grid.


    In this example I create a container with a textbox and a button.

    First, create the procedure to create the container and the objects you want.

    I did this in the custom library of the page.


    proc mycontainer
    mycontainer = createobject("container")
    mycontainer.layout = "horizontal"
    mycontainer.height = 50
    mycontainer.addobject("text1","textbox")
    mycontainer.addobject("btn1","commandbutton")
    btn1.caption ="Custom Button"

    return mycontainer


    Then I added a new column in the grid by right clicking the header of an existing column and selecting "Insert Column After"

    The in the attributes of the new column, I entered mycontainer in the custom control option.

    Name:  cusstomgrid1.jpg
Views: 196
Size:  39.9 KB


    Then you can see the custom container in my grid.

    Name:  customgrid2.jpg
Views: 1073
Size:  29.6 KB

    Is this what you are trying to achieve?

    Herb

  3. #3
    So - if you need to have a tooltip, You just add it.


    proc mycontainer
    mycontainer = createobject("container")
    mycontainer.layout = "horizontal"
    mycontainer.height = 50
    mycontainer.addobject("text1","textbox")
    mycontainer.addobject("btn1","commandbutton")
    btn1.caption ="Custom Button"
    text1.tooltip ="this is tooltip"

    return mycontainer



    Name:  customgrid3.jpg
Views: 954
Size:  29.1 KB

  4. #4
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Many thanks Herb, I try.
    But I can use also "Get" and "set" datamapping?
    Autosuggestion?
    and the other formfield attribute?

    thanks
    Fabio

  5. #5
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    I've see here http://www.lianja.com/doc/index.php/Textbox
    and here http://www.lianja.com/doc/index.php/...:Common_Events

    Set and Get data mapping are not supported, but autosuggestion yes..
    then I can use "valid" instead of "change" delegate.

    now though .. if you use custom controls in the grid, to create the same appeal, I have to use custom controls for the section "edit records at one time" (eg. Sales header), then replace the standard section with the custom section .. losing the functionality already present in lianja, such as filters, research etc ..

    I have to think about it ..

  6. #6
    Fabio,

    It's definitely possible, but I wonder if you are trying to put a square peg in a round hole.

    Meaning - there are probably better ways for you to accomplish the same thing.

    It seems that you want to display all your data in a grid and have that grid the basis of all your functionality.

    If the idea is that you want your clients to see a lot of data at once, that's fine. But you should consider using a mix of inline edits and dialog panels.

    It accomplishes the same goal, but is much cleaner.

    Looking at your example in different post, you have some larger field that you want to edit. For those field, use the hyperlink to bring up a dialog box for the edit. This way you have a clean edit, not in a small field, you are using a best practice and properly creating a modern application and you do not lose any functionality.

    Have a look at this example.

    I concatenated firstname, lastname and address into one field.

    If I want to edit that field, I just click on the link and bring up a dialog window.

    I accomplish everything I a looking to do in a very intuitive way without trying to re-invent the wheel.

    Name:  GridLInk1.jpg
Views: 1000
Size:  81.9 KB


    In the linkclick section of my page, I call the dialog window.


    ////////////////////////////////////////////////////////////////
    // Event delegate for 'linkclick' event
    proc page1_section1_linkclick()

    Lianja.showdialog("Employee Edit","pgEmployeeEdit",500,500)
    // This refreshes the grid to show the new values
    Lianja.get("section1").refresh
    endproc

    The result.

    Name:  gridlink2.jpg
Views: 1023
Size:  56.3 KB

  7. #7
    Just an FYI.

    If I was building this for web, I would call the showdialog with a parameter and an action.
    In the desktop, it is already on the record pointer.

    Herb

  8. #8
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Hi Herb, your point of view, is a good start point..

    my point is this:

    in some cases it is better to work on the grids (for example, when I insert the lines of a sales order, work on the single record is more uncomfortable), if I have to enter only part number and quantity .. in other cases, it is more convenient to work on single record, if I go to set the unit of measurement, the batch number, the project, etc. or if I have to work on the order header, where I have about 80 fields ..

    To my user, I want to give the same "feeling", and in one case than the other.

    In my VFP application, in the field's grid, I've the same control of the single-row edit.

    that's why I said, if I have to put a custom control on the grid, after I have to use the section ..

    In this sample form for the price list, is better edit the row.. if I need to change the "quantity" or the "validity range date". But in the column where I've used the "Get data mapping" to display the "lookup", I cannot edit the field.. then I need to go on the single-row edit, where is editable..
    Name:  Screenshot - 04_03_2015 , 13_10_36.jpg
Views: 317
Size:  71.4 KB

    If I try with your approach, and I need to change the column "quantity", I need to select the row, edit and close the showdialog..
    Then, I need to create a lot of server page..

    Herb.. sorry for my english.. I try to explain how I can..

    thanks
    Fabio

  9. #9
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,184
    Hi Phabio,

    Herb showed you how to get multiple controls in one grid cell. So you would do as you do in VFP: make a container that has all the controls needed to edit a row, and then have one column in the grid containing the container.

    Hank

  10. #10
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Hi Hank, yes, it is as I understand (even is not simple to understand from my english..).

    I have to think about it .. we are talking about the project on 20-30 app .. 2-300 tables ..

    write a container for each field of each section of each page, each app .. it seems too long.

    If I could use the standard, would be much better.

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