B4J Tutorial SithasoDaisy TailwindCSS UI Toolkit: Q & A

Hi there

NB: Where possible, please include a simple project that demonstrates your use case.

Do you have any questions about SithasoDaisy UI Toolkit?

You can shoot it here and we will oblige.

Thanks in advance?


Join on Telegram


Check $5 WebApps

 
Last edited:

Gianni M

Well-Known Member
Licensed User
Longtime User
with demo sithasodaisy online https://sithasodaisyui.netlify.app/
into page "Tables - Designer", "AD Table" there is a total footer
B4X:
Sub Mounted
    Dim summary As Map = SDUITable1.SetFooterTotalSumCountColumns(Array("progress"))
    srowcount = summary.Get("rowcount")
    srowcount = SDUIShared.Thousands(srowcount)
    SDUITable1.SetFooterColumn("avatar", $"Total (${srowcount})"$)
when click on "Next Page" or "Previous Page", footer column HIDE

it's a bug or ???
 

Mashiane

Expert
Licensed User
Longtime User
with demo sithasodaisy online https://sithasodaisyui.netlify.app/
into page "Tables - Designer", "AD Table" there is a total footer
B4X:
Sub Mounted
    Dim summary As Map = SDUITable1.SetFooterTotalSumCountColumns(Array("progress"))
    srowcount = summary.Get("rowcount")
    srowcount = SDUIShared.Thousands(srowcount)
    SDUITable1.SetFooterColumn("avatar", $"Total (${srowcount})"$)
when click on "Next Page" or "Previous Page", footer column HIDE

it's a bug or ???
Hi, it's by design, you need to have prevpage and nextpage events. Below is an example based on one of my projects. This was highlighted before in the project threads so its understandable to be missed.

B4X:
'the previous button has been clicked
Private Sub tblbeneficiary_PrevPage (e As BANanoEvent)
    e.PreventDefault
    tblbeneficiary.SetFooterColumn(tblbeneficiary.FirstColumnName, $"Total (${srowcount})"$)
End Sub
'
'the next button has been clicked
Private Sub tblbeneficiary_NextPage (e As BANanoEvent)
    e.PreventDefault
    tblbeneficiary.SetFooterColumn(tblbeneficiary.FirstColumnName, $"Total (${srowcount})"$)
End Sub

Pagination should be true and ItemsPerPage also set also as usual.
 

Gianni M

Well-Known Member
Licensed User
Longtime User
I have a doubt or I don't understand
into AD, we set SDUIPage "Page Name *"
with "The unique name of page this should match yout module 'name' variable

also SDUIRow, property "ParentID", set "The ParentID of this div"

now into module/page "Test1"
we load layout
B4X:
banano.LoadLayout(app.PageViewer, "namelayout")
and it's OK!

now we have another module/page "Test2"
we load same layout
B4X:
banano.LoadLayout(app.PageViewer, "namelayout")
it works well

I don't understand!!
I can use a same layout into different module?
 

sdleidel

Active Member
Licensed User
Longtime User
BANano.TranspilerOptions.RemoveDeadCode =true
in "Release Mode" this bricks my Webapp with Bannano 9.10
I set it to false and the Web app run...
 

Gianni M

Well-Known Member
Licensed User
Longtime User
usually my code:
B4X:
BANano.TranspilerOptions.UseServiceWorker = False
    BANano.TranspilerOptions.MinifyOnline = False
    BANano.TranspilerOptions.RemoveDeadCode = False
    BANano.TranspilerOptions.IgnoreWarningsOldBrowsers = True
    BANano.TranspilerOptions.ShowWarningDeadCode = False
    BANano.TranspilerOptions.MergeAllCSSFiles = False
    BANano.TranspilerOptions.MergeAllJavascriptFiles = False
    BANano.TranspilerOptions.EnableLiveCodeSwapping = False
    BANano.TranspilerOptions.DisableShortenVariableNames = True
 

Gianni M

Well-Known Member
Licensed User
Longtime User
is there a technique to create a "collapse" row using "SDUITable" ?
each row can contain 0 to maximum 100 elements;
Each row can have different elements
 

Gianni M

Well-Known Member
Licensed User
Longtime User
SDUIMySQLREST and NextID
problem with generating a unique id

is there a problem of getting the same ID?
B4X:
Sub NextID As String
    Dim ni As String = "i" & guidAlphaApp(14)
    Return ni
End Sub
and
B4X:
#if javascript
function guidAlphaAppi(len) {
        var buf = [],
            chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
            charlen = chars.length,
            length = len || 32;
            
        for (var i = 0; i < length; i++) {
            buf[i] = chars.charAt(Math.floor(Math.random() * charlen));
        }
        
        return buf.join('');
    }
#end if
 

Mashiane

Expert
Licensed User
Longtime User
SDUIMySQLREST and NextID
problem with generating a unique id

is there a problem of getting the same ID?
B4X:
Sub NextID As String
    Dim ni As String = "i" & guidAlphaApp(14)
    Return ni
End Sub
and
B4X:
#if javascript
function guidAlphaAppi(len) {
        var buf = [],
            chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
            charlen = chars.length,
            length = len || 32;
           
        for (var i = 0; i < length; i++) {
            buf[i] = chars.charAt(Math.floor(Math.random() * charlen));
        }
       
        return buf.join('');
    }
#end if
As the function is not based on date time, a possibility of a duplicate nextID is possible for a very small margin of cases.

You can define your own function to generate unique ID also for your records. Also when initializing the class you can indicate the auto increment field, which will be generated by your database.
 
Top