B4J Library [BANano] UOEGridTable: An interesting grid that you might like

Mashiane

Expert
Licensed User
Longtime User
Let's say you wanted to format some of the text, e.g. FileSizes.
Using the numeral.js lib, you just add the relevant column type.

FileSize Format

B4X:
gridcountries.AddColumn("population","Population",gridcountries.COLUMN_FILESIZE,0,True,gridcountries.ALIGN_RIGHT)



Money Format

To format the data as money, use the relevant column type for money also.

B4X:
gridcountries.AddColumn("population","Population",gridcountries.COLUMN_MONEY,0,True,gridcountries.ALIGN_RIGHT)



#ComingSoon
 

Mashiane

Expert
Licensed User
Longtime User
Formatting Date Time Columns

To format a column, you can set a column format based on these attributes.

B4X:
Format the date when the type of the column is date.

d - Day of the month as digits; no leading zero for single-digit days.
dd - Day of the month as digits; leading zero for single-digit days.
m - Month as digits; no leading zero for single-digit months.
mm - Month as digits; leading zero for single-digit months.
yy - Year as last two digits; leading zero for years less than 10.
yyyy - Year represented by four digits.
s - Seconds; no leading zero for single-digit seconds.
ss - Seconds; leading zero for single-digit seconds.
M - Minutes; no leading zero for single-digit minutes. Uppercase MM to avoid conflict with months.
MM - Minutes; leading zero for single-digit minutes. Uppercase MM to avoid conflict with months.
H - Hours; no leading zero for single-digit hours (24-hour clock).
HH - Hours; leading zero for single-digit hours (24-hour clock).
h - Hours; no leading zero for single-digit hours (12-hour clock).
hh - Hours; leading zero for single-digit hours (12-hour clock).
tt - Lowercase, two-character time marker string: am or pm.
TT - Uppercase, two-character time marker string: AM or PM.

You can do this by using the .SetColumnFormat method and specify the format like HH:MM.

If you add a column as COLUMN_DATE, the default format will be yyyy-mm-dd and if you set it to COLUMN_TIME, the format will be HH:MM, a 24 hour time line. The demo below is for a column added with..

Formatting Time

B4X:
uoegrid.AddColumn("DateOfBirth","Time of Birth", uoegrid.COLUMN_TIME,150,False,uoegrid.ALIGN_CENTER)



Formatting Dates

B4X:
uoegrid.AddColumn("DateOfBirth","Date of Birth", uoegrid.COLUMN_DATE,150,False,uoegrid.ALIGN_CENTER)

 
Last edited:

roberto64

Active Member
Licensed User
Longtime User
hi, how do you change the type of calendar based on nationality, e.g. IT or de-de and so on?
regards
 

Juanmavalero

Member
Licensed User
Longtime User
Hello I need help with this error. The web is based on a grid that load data from MySQL database. When I test from localhost it works but from hosting not work

URL: stock.vpsolutions.es

 

Attachments

  • 1621424295592.png
    93.3 KB · Views: 175
  • 1621425114224.png
    66.2 KB · Views: 179
Last edited:

Mashiane

Expert
Licensed User
Longtime User
ok the problem is for insecured http domain
and over https there are new errors

View attachment 113715
Please start a new thread about your issue, this is not necessarily related to the grid but is some other issue.

If you dont mind, PM me a simple project that you are experiencing this from so that I can look.

I also think Alain did respond to this issue when you spoke about this on his thread.

I have just found out this thread also, https://www.b4x.com/android/forum/threads/banano-inline-php-problem.104488/#post-654808
 

Juanmavalero

Member
Licensed User
Longtime User
I looks like you are deploying your app in debug mode, not release mode. This causes the 'live code swapping' to be active and can be a cause for the 'sleep' errors.


Was a different issue
Thanks you I deploy in release mode but there are various errors:
 

alwaysbusy

Expert
Licensed User
Longtime User
Those are warnings in the CSS (like before). Yellow is warning, red are errors. When I go to http://stock.vpsolutions.es/, I still see the 'debug' version.

Unrelated, but a very dangerous thing you seem to do, is passing an SQL query in your javascript code:
B4X:
// [49]  Dim query As String = {30}
_query="SELECT descrip,cantidad,ubicacion,proveedor from stock order by descrip";
// [51]  Dim tbl As MySQLResultSet = dbsql.Execute(query)
_tbl=_dbsql.execute(_query);
// [52]  tbl.json = BANano.CallInlinePHPWait( {31} , dbsql.Build(tbl))
_tbl._json=await callAjaxWait('http://stock.vpsolutions.es/stock.php','POST','json', JSON.stringify({"request": "BANanoMySQL", "params": _dbsql.build(_tbl)}),false,null);
// [54]  dbsql.JSONToResultSet(tbl)
_dbsql.jsontoresultset(_tbl);

I hope you are aware anyone can easily manipulate this and change the query to 'DROP TABLE stock' or 'DELETE FROM stock' and delete all your data.

This query should be moved to your PHP file.

Alwaysbusy
 

Juanmavalero

Member
Licensed User
Longtime User
Hi , I did th deploy in release mode but in this domain www.vpsolutions.es
That is because de subdomain stock.vpsolutions.es was not over SSL
Finally I have this errors:
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…