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:

Mashiane

Expert
Licensed User
Longtime User
SDUITable1.SetColumnComputeValue("qta", "subqta") 'ok event "subqta"
When ever you are adding a row on the table, first "compute the value" of the "qta" column by calling the "subqta" sub routine.

The "subqta" subroutine should receive an item, which is a map object of the current row. This changes the value shown on the column.

B4X:
tbl.SetColumnComputeValue("agroup", "ComputeAgroupValue")

Sub ComputeAgroupValue(item As Map) As String
'get the amount for this row
dim samount As String = item.get("amount")
dim sqta as String = item.get("qta")
'convert to double & compute
Dim totalx As Double = SDUIShared.CDbl(samount) * SDUIShared.CInt(sqta)
totalx = SDUIShared.CDbl(totalx)
return totalx
End Sub
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
SDUITable1.SetColumnClass ("qta", "subqta") 'no event "subqta"
When ever you are adding a row on a table, first "compute the class" of the "qta" column by calling the "subqta" sub routine.

The "subqta" subroutine should receive an item (map). This adds a class to that column. For example, if you wanted to change the text color to red depending on a value of another column.

B4X:
tbl.SetColumnComputeClass("agroup", "ComputeAgroupClass")

Sub ComputeAgroupClass(item As Map) As String
'get the amount for this row
dim samount As String = item.get("amount")
'convert to double
dim iamount As Int = sduishared.CDbl(samount)
if iamount < 0 then
the text color should be red if amount < 0
return "text-red"
else
the text color should be green if amount > 0
return "text-green"
end if
End Sub
 
Last edited:

giannimaione

Well-Known Member
Licensed User
Longtime User
next month i will subscript SITHASO HOLDINGS (PTY) LTD
 

giannimaione

Well-Known Member
Licensed User
Longtime User
another question

visual designer
SDUITextBox1
custom properties:
"Input Type default"
"Max Length 3" -> it is ok user can type only 3 char

but into SDUITable
B4X:
    SDUITable1.AddColumnTextBox("qta", "Quantità", False) 'edit on table
    SDUITable1.SetPropertyType("qta", "default")
    SDUITable1.SetPropertyMaxLength("qta", "3") 'max 3 char, but NOT OK
I made a mistake
 

sdleidel

Active Member
Licensed User
Longtime User
FullCalendar
Can you add 2 more events if you move an entry and if you virtually make a new one with the mouse? When pulling down with the mouse.

And /or an event when you click on an empty area so that you can enter a new appointment?

How do I find out what I have marked?
 

giannimaione

Well-Known Member
Licensed User
Longtime User
into visual designer:

SDUITextBox : input = date-picker
not align top (see text3 and text4 -> SDUITextBox)
Cattura.PNG

and how to set 20-06-2023 ? (I made several attempts dd-mm-yyyy)
in MAIN module
B4X:
DateTime.DateFormat="dd/MM/yyyy"
but i have no success
 

Mashiane

Expert
Licensed User
Longtime User
into visual designer:

SDUITextBox : input = date-picker
not align top (see text3 and text4 -> SDUITextBox)
View attachment 143077
and how to set 20-06-2023 ? (I made several attempts dd-mm-yyyy)
in MAIN module
B4X:
DateTime.DateFormat="dd/MM/yyyy"
but i have no success
You have not attached your layout for me to see how your design is made. I can't really advise with not enough information.

You set the date format in the control itself and not via code. Check the properties.
 

Mashiane

Expert
Licensed User
Longtime User
another question

visual designer
SDUITextBox1
custom properties:
"Input Type default"
"Max Length 3" -> it is ok user can type only 3 char

but into SDUITable
B4X:
    SDUITable1.AddColumnTextBox("qta", "Quantità", False) 'edit on table
    SDUITable1.SetPropertyType("qta", "default")
    SDUITable1.SetPropertyMaxLength("qta", "3") 'max 3 char, but NOT OK
I made a mistake
I am sure it is. Are you experiencing any problems when setting this on the abstract designer?

1687275410135.png


in code.

B4X:
SDUITextBox1.MaxLength = 3
 

Mashiane

Expert
Licensed User
Longtime User
into visual designer:

SDUITextBox : input = date-picker
not align top (see text3 and text4 -> SDUITextBox)
View attachment 143077
and how to set 20-06-2023 ? (I made several attempts dd-mm-yyyy)
in MAIN module
B4X:
DateTime.DateFormat="dd/MM/yyyy"
but i have no success
I have made some adjustments to your layout, when placing components inside others, please follow this kind of approach and not put components on top of others.
Its better to have some spaces between the components e.g edges.

For the textboxes to be inline with the date-picker, the textboxes should be type 'input-group' and not 'default'.

1687278288342.png
 

Attachments

  • homelayout1.zip
    3 KB · Views: 109

giannimaione

Well-Known Member
Licensed User
Longtime User
I am sure it is. Are you experiencing any problems when setting this on the abstract designer?
my code
B4X:
    'rigo is SDUITable define on visual designer
    rigo.ClearPropertyBag
    rigo.AddColumnTextBox("qta", "Quantità", False) 'edit on table (OK!)
    rigo.AddColumn("codice", "Codice")
    rigo.AddColumn("descrizione", "Descrizione")
    rigo.SetPropertyMaxLength("qta", "3") ' not ok *************************************************
    rigo.SetColumnAlign("qta", "r") ' right alignment (OK!)
    rigo.AddDesignerColums
 

Mashiane

Expert
Licensed User
Longtime User
rigo.SetPropertyMaxLength("qta", "3") ' not ok *************************************************
I see, you want to set the maxlength of a column in a table. Calling .SetPropertyMaxLength only works when the table is set to property bag mode.

At the moment there is no functionality to set this at column level. I will add it for the next release.

The method will be:

B4X:
tb.SetColumnMaxLength("qta", 3)
 
Last edited:

sdleidel

Active Member
Licensed User
Longtime User
Bug in SDUIListView ?
For example, I've tried executing the following commands:


1:
lv.ImageVisible=False
lv.RightIconVisible=False
lv.LeftIconVisible=False
lv.SetItemRightIconVisible("p1",False)

But the listview doesn't change.
Is there a trick or is it a bug?
 
Top