is it possible to populate listbox and listview with more than one column ?
Have you looked at the Canvas Section ‘TreeGrid‘ control? Specify the text for the ‘Header labels’ and a SQL Select statement for ‘List items’. In the ‘click’ event you can get x.CurrentItem.text, CurrentItem being the currently selected treeitem object.
Or, in a Form Section, you can use the Grid gadget for multiple columns.
If there is a reason you HAVE to use a list instead of grid, you could concatenate the result of a query, but I don’t recommend it.
This would work, but it would look ugly unless you forced some blank characters in to align it.
select first_name+" "+last_name from example
LIST VIEW. I noticed that you can set text as items, can I populate it with table fields?
I add the items by using additems().
I named the listview gadget list1.
mylistview=Lianja.get("page1.section2.list1") mylistview.additems("select last_name from example")
field1 is in a canvas section with listbox
testadress is the table.
proc page1_section1_field1_ready() x=Lianja.get("page1.section1.field1") x.additems="select name from testadress" endproc
Also in Load or activate.
Does’nt work, listbox won’t populate, stay’s empty.
Tried it in Form section with List view, same result.
Additems() is a method not a property.
x.additems="select name from testadress"
x.additems("select name from testadress")
in which event additems method can be used to load initial value in the list or combo item when the app starts.
Use the ‘ready’ event. During development in the Lianja App Builder, the ‘ready’ event is called when the App is loaded, so just save and reload the App to force the ‘ready’ event to be called and see your new code.
An example of using a draggable list to visually reorder records.
Lianja OrderedLists – https://youtu.be/9Vswi2GkcHw