B4J Library [BANanoVueMaterial]: The first complete opensource VueJS UX based framework for BANano

Mashiane

Expert
Licensed User
Longtime User
BANanoVueMaterial - Table Selects



To activate the "select all" button on a table

B4X:
dt1.SetShowSelect(True)
    dt1.SetOnToggleSelectAll("dt1_selectall")

Then add an event to trap the selected items

B4X:
Sub dt1_selectall(items As List)
    Log(items)
End Sub

To trap selection of a single item:

B4X:
dt1.SetOnItemSelected("dt1_itemselected")

And the callback...

B4X:
Sub dt1_itemselected(item As Map)
    Log("item selected")
    Log(item)
End Sub

The demo example on the next release will be updated...
 

Mashiane

Expert
Licensed User
Longtime User
Upcoming Changes: Added ability to setfocus to a control.

Example..


B4X:
Dim txtEmail As VMTextField = vm.NewEmail(Me, True, "txtemail", "email", "Email Address","", True, "email", "Enter email address here", "The email address is required!", 0)

Run validation and if there is an error focus on "txtEmail"

B4X:
Sub btnOkSignIn_click(e As BANanoEvent)
    'get the contents of the form
    Dim rec As Map = mdlSignIn.Container.GetData
    'validate the details
    Dim bValid As Boolean = mdlSignIn.Container.Validate(rec)
    If bValid = False Then
        vm.ShowSnackBar("You need to specify both the email address and password!")
        vm.SetFocus("txtemail")
        Return
    End If
    vm.ShowSnackBar(BANano.tojson(rec))
    'process further
End Sub
 

Mashiane

Expert
Licensed User
Longtime User
Upcoming Changes: Invisible File Selector

At times you just want to click an image / button and activate a file selector:



We have

B4X:
vm.AddFileSelect(Me, "fucomponent")

Then let's show it whenever we want. e.g. in a _click event

B4X:
vm.ShowFileSelect("fucomponent")

We then trap the change event...

B4X:
Sub fucomponent_change(e As BANanoEvent)
    Dim fileList As List = vm.GetFileListFromTarget(e)
    Log(fileList)
End Sub
 

Mashiane

Expert
Licensed User
Longtime User
Upcoming Changes: VMDataTable.GetItemKeys

The VMDataTable has an event call OnInput. This fires each time selected items change on a table. This returns a list of map records that have been selected.

GetItemKeys is a new sub for the data table to return a list of keys that have been selected. This is based on the primary key that was specified when the VMDataTable is initialized. There is no built in functionality to return what is not selected.

Define the event.

B4X:
dt1.SetOnInput("dt1_input")

The dt1 is defined in process_globals

Trap the callback.

B4X:
Sub dt1_input(items As List)
    Log("selected items")
    Dim selKeys As List = dt1.GetItemKeys(items)
    Log(selKeys)
    'join the items
    Log("String Join")
    Dim selItems As String = vm.JoinItems(",", "'", selKeys)
    Log(selItems)
    'normal join
    Log("Normal Join")
    Dim selNormal As String = vm.Join(",", selKeys)
    Log(selNormal)
End Sub

Results



Known Issues: This event fires twice.
 

swamisantosh

Member
Licensed User
Longtime User
ex
excellent
 

swamisantosh

Member
Licensed User
Longtime User
we should option to import data from XLS, CSV to database tables.
 

swamisantosh

Member
Licensed User
Longtime User
already you have implemented Download & Upload Component Schemas ,importing xls,csv format should be not big issue
 

Mashiane

Expert
Licensed User
Longtime User
Important Announcement!!! Importing Component Schemas

Previously we indicated that one can export and will be able to import component schemas. This means one can create the schema of the app, see it functional and email it to another to open in the designer and continue creating the app.



PS: Maintenance version 3.82 out with this feature!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…