Database,Datagrid and Styled text

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm

Database,Datagrid and Styled text

Post by Youks » Sat Oct 01, 2011 1:05 pm

Hi All,
I created a sqlite database containing about 4000 rows of 10 columns each (primary key on rowid).
I have use the this function:

--put "SELECT *FROM Mytable" into tSQL
--put revDataFromQuery(tab,cr, gConID, tSQL) into tData
--set the itemdelimiter to tab
--set the columndelimiter to comma

So far i am able to retrieve the informations using the "items i of line l" but here is my problem;

1)I want ot search a string in one of the columns of the database and determine its line (or row) so i can work on the line and display its items.
2) Do i need to populate my database into datagrid to facilitate the queries?
3) In the database,some of the records contains <b>,</b> and other styles(or HTML not sure!) but when i display them into fields in the app,they still appear that way........i tried the functions like plaintext,htmltext to apply their style etc.... but no joy!

Many Thx your Help!

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm

Re: Database,Datagrid and Styled text

Post by Youks » Mon Oct 03, 2011 8:54 pm

Hi all,

I could find a way of solving some of my "basic issues" with the database but i still need help on how to display the special HTML character on a field.
When using HTMLtext function some of them couldn't be displayed.

Many Thanks.

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Database,Datagrid and Styled text

Post by bangkok » Mon Oct 03, 2011 10:45 pm

You can achieve this by adding a regular text field in the row / column template of your datagrid.

Then in the script of the column behavior, you can use something like :

set the htmltext of fld "newfield" of me to "<B>This is bold</B>"


Look at the stack.
Attachments
TESTDG.zip
(5.84 KiB) Downloaded 245 times

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm

Re: Database,Datagrid and Styled text

Post by Youks » Wed Oct 05, 2011 2:49 pm

Hi Bangkok,

Thanks for your reply but the problem i am facing (i'm new to database!!) is how to make a specific search of a value in a column of the database in order to get its line(row) and then display its datas into specific fields.

When using "revformquery" i'm able to chunk the line without any problem.
1)Is it better to work with "revdatabasequery"? (to get the line of the data through the cursor)
2)Do i need to populate the database into arrays?

Regards, :oops:

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm

Re: Database,Datagrid and Styled text

Post by Youks » Wed Oct 05, 2011 7:38 pm

Hi All,

I haven't coded for so long and what a shame.......i just figured out how to do that stupid thing!
It's all about practice!!
rgds :oops:

Post Reply