B4J Library [Web] SithasoDaisy: TailwindCss WebApps powered by B4x & BANano

Mashiane

Expert
Licensed User
Longtime User
PLEASE DO NO ASK QUESTIONS.. USE

 

Mashiane

Expert
Licensed User
Longtime User
Please redownload 1.31 (updated now), which addresses the locales for the FullCalendar and some other bug fixes.

Thanks

 

Mashiane

Expert
Licensed User
Longtime User
Table Append Icons - Loading



B4X:
Private Sub tb4_btnload (item As Map)
    'get the id of the record
    Dim sid As String = item.Get("id")
    'find the position of the record using the id
    Dim pos As Int = banano.Await(tb4.FindRowByColumn("id", sid))
    'get the caption of the button
    Dim btnCaption As String = banano.Await(tb4.GetRowColumn("btnload", pos))
    '
    Select Case btnCaption
    Case "Process"
        'change the caption to
        tb4.SetRowColumn("btnload", pos, "Loading")
        'set the append icon to loading
        tb4.SetRowColumnAppendLoading("country", pos, True)
    Case "Loading"
        'change the caption to
        tb4.SetRowColumn("btnload", pos, "Process")
        'set the append icon to not-loading
        tb4.SetRowColumnAppendLoading("country", pos, False)
    End Select
End Sub
 

Mashiane

Expert
Licensed User
Longtime User
Table Append Icons - Changing



B4X:
Private Sub tb4_btnicon (item As Map)
    'get the id of the record
    Dim sid As String = item.Get("id")
    'find the position of the record using the id
    Dim pos As Int = banano.Await(tb4.FindRowByColumn("id", sid))
    'get the caption of the button
    Dim btnCaption As String = banano.Await(tb4.GetRowColumn("btnicon", pos))
    '
    Select Case btnCaption
    Case "Flag"
        'change the caption to
        tb4.SetRowColumn("btnicon", pos, "Insta")
        'set the append icon to insta
        tb4.SetRowColumnAppendIcon("country", pos, "fa-brands fa-instagram")
    Case "Insta"
        'change the caption to
        tb4.SetRowColumn("btnicon", pos, "Flag")
        'set the append icon to flag
        tb4.SetRowColumnAppendIcon("country", pos, "fa-regular fa-flag")
    End Select
End Sub
 

Mashiane

Expert
Licensed User
Longtime User
Table Menus

B4X:
tb2.AddColumnDropDown("menu", "Menu", "fa-solid fa-ellipsis-vertical", "#3f51b5", CreateMap("edit":"Edit","delete":"Delete","clone":"Clone","print":"Print"))



B4X:
Private Sub tb2_MenuRow (Row As Int, Action As String, item As Map)
    Log(Row)
    Log(Action)
    Log(item)
End Sub

set menu item colors

B4X:
tb2.SetMenuItemHoverColorIntensity("blue", "100")
    tb2.SetMenuItemFocusColorIntensity("blue", "100")
    tb2.SetMenuItemActiveColorIntensity("blue", "100")
 

Mashiane

Expert
Licensed User
Longtime User
Table ToolBar Menus




We add a toolbar menu button with 3 options..

B4X:
Dim ddown As SDUIDropDown = SDUITable1.AddToolbarDropDownIcon("ddown", "fa-solid fa-bars", app.COLOR_ORANGE)
    ddown.AtEnd
    ddown.RoundedBox
    ddown.shadow("")
    ddown.ItemHoverColorIntensity("blue", "100")
    ddown.ItemFocusColorIntensity("blue", "100")
    ddown.ItemActiveColorIntensity("blue", "100")
    '
    ddown.AddItemIcon("export2pdf", "fa-regular fa-file-pdf", "Export to PDF")
    ddown.AddItemIcon("export2xls", "fa-regular fa-file-excel", "Export to XLS")
    ddown.AddItemIcon("export2csv", "fa-solid fa-file-csv", "Export to CSV")

We trap the events, in this case we want to export the table contents to csv file.

B4X:
Private Sub SDUITable1_ddown_Click (item As String)
    Select Case item
    Case "export2pdf"
    Case "export2csv"
        Dim content As String = banano.Await(SDUITable1.ExportToCSV(True, ",", True))
        app.Download(content, "table2csv.csv")
    Case "export2xls"
    End Select
End Sub
 

Mashiane

Expert
Licensed User
Longtime User
Coming Updates to V1.34 SDUITable PropetyBag



Add Avatar with Online/Offline Status

B4X:
SDUITable1.AddPropertyAvatar("online", "Avatar Online", "", "12", app.MASK_CIRCLE, "./assets/face11.jpg")
    SDUITable1.SetPropertyAvatarOnline("online", True, True)

Add Avatar with ring

B4X:
    SDUITable1.AddPropertyAvatar("hasring", "Avatar ring", "", "12", app.MASK_CIRCLE, "./assets/face11.jpg")
    SDUITable1.SetPropertyAvatarRing("hasring", True, app.COLOR_PRIMARY)

Add Avatar Group

B4X:
    SDUITable1.AddPropertyAvatarGroup("agroup", "Avatar Group", "", "12", app.MASK_CIRCLE, Array("./assets/1.jpg","./assets/2.jpg","./assets/3.jpg","./assets/4.jpg", "./assets/Angela.jpg"))

Change/Update Avatar Group Images

B4X:
SDUITable1.SetPropertyAvatarGroupItems("agroup", "12", app.MASK_SQUIRCLE, Array("./assets/Anna.jpg","./assets/daisywoman3.png","./assets/face25.jpg","./assets/sponge.png"))

 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
SDUITable AvatarGroup



B4X:
tb4.AddColumnAvatarGroup("agroup", "Resources", "2rem", app.MASK_CIRCLE)
tb4.SetColumnComputeValue("agroup", "Computeagroup")

B4X:
Sub Computeagroup(item As String) As String
    Return $"./assets/Angela.jpg;./assets/Anna.jpg;./assets/daisywoman3.png;./assets/daisywoman1.jpg;./assets/face13.jpg;./assets/profile12.jpg"$
End Sub

Changing the row column avatar group

B4X:
tb4.SetRowColumn("agroup", 2, $"./assets/team-1.jpg;./assets/team-2.jpg;./assets/team-3.jpg;./assets/team-4.jpg;./assets/team-5.jpg"$)


 

Mashiane

Expert
Licensed User
Longtime User
SDUITable Avatar Placeholder



Add the column

B4X:
tb4.AddColumnAvatarPlaceholder("hours", "Hours", "3rem", app.MASK_CIRCLE, "primary")

Change the value of the row column avatar placeholder

B4X:
tb4.SetRowColumn("hours", 1, "99+")

SDUITable Badge Variants & Tags



B4X:
tb4.AddColumnBadgeAvatarTitle("avatar", "Resource", "10", "name", "")
tb4.AddColumnBadgeGroup("tags", "Tags", "10")
banano.Await(tb4.SetItemsPaginate(Items))  'or SetItemsPaginate
tb4.SetRowColumn("tags", 1, $"a:success; n:warning; e:primary; l:neutral; e:error"$)
End Sub
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
SDUITable Totals

This sums up column values and set them on foote



B4X:
''start building the page
Private Sub BuildPage
    banano.LoadLayout(app.PageViewer, "summaryperimpactlayout")
    'Set property bag for input
    banano.Await(pbsummaryperimpact.LoadPropertyBagFromJSON("./assets/summaryperimpact.json"))
    'tblsummaryperimpact.AddColumn("id", "#")
    tblsummaryperimpact.AddColumn("balanceimpact", "Impact")
    tblsummaryperimpact.AddColumnMoney("gross", "Gross")
    tblsummaryperimpact.AddColumnMoney("fee", "Fee")
    tblsummaryperimpact.AddColumnMoney("net", "Net")
    'Add edit/delete etc columns
    'tblsummaryperimpact.AddDesignerColums
    tblsummaryperimpact.AddColumnAction("view", "View", "fa-solid fa-eye", "#797EF6")
    'Mount the records
    banano.Await(mounted)
    'total sum of columns on footer
    Dim summary As Map = banano.Await(tblsummaryperimpact.SetFooterTotalSumCountColumns(Array("gross","fee","net")))
    'get the rowcount
    Dim srowcount As String = summary.Get("rowcount")
    'set the footer column to reflect total
    tblsummaryperimpact.SetFooterColumn("balanceimpact", $"Total (${srowcount})"$)
End Sub
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
SDUITable RadioGroup



B4X:
tb4.AddColumnRadioGroup("gender", "Gender", False, app.COLOR_PRIMARY, CreateMap("male":"Male","female":"Female"))

trap row change event

B4X:
Private Sub tb4_ChangeRow (Row As Int, Value As Object, Column As String, item As Map)
    Dim x As Map = CreateMap()
    x.Put("row", Row)
    x.Put("column", Column)
    x.Put("value", Value)
    Dim s As String = banano.ToJson(x)
    app.ShowSwal(s)
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…