Table field: Title Row & no input

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
simon.schvartzman
Posts: 641
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Table field: Title Row & no input

Post by simon.schvartzman » Thu Aug 20, 2020 8:56 pm

Hi guys, first time working with a Table field and having 2 (very) basic questions:

1 - is it possible to freeze the first row for it to remain fixed as I scroll down the table? How?
2 - On one hand I don't want the table to be editable but on the other I'd like to be able to navigate through all its lines by scrolling up and down. If I set disable to true (no input) then I can't navigate...

What am I missing?

Thanks for your inputs
Simon
________________________________________
To ";" or not to ";" that is the question

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9665
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Table field: Title Row & no input

Post by dunbarx » Thu Aug 20, 2020 9:33 pm

Hi.

All doable easily, all kludges.

You cannot "freeze" the first line when scrolling. Overlay a one line table field with all the same text properties as the main one, and load it with line 1. If you do it nicely, the field can stay there all the time and nobody will know the difference.

To allow the main field to scroll and still not be editable requires that you overlay, say a rectangular opaque graphic with its blendLevel set to 100. Again, if done nicely, nobody but you and I would know. You need to leave the vertical scrollBar of the main field exposed.

If you do decide to allow editing, that one line field has to load line 1 into the underlying "main" field. And the overlying graphic has to become not opaque.

All doable...

Craig

simon.schvartzman
Posts: 641
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Re: Table field: Title Row & no input

Post by simon.schvartzman » Thu Aug 20, 2020 9:49 pm

Thanks Craig, I'd consider to file a feature request as both functionalities seem useful to me and should deserve its own property...

Best!
Simon
________________________________________
To ";" or not to ";" that is the question

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9665
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Table field: Title Row & no input

Post by dunbarx » Thu Aug 20, 2020 10:03 pm

Simon.

Go ahead, but let me know how the kludges work out...

Craig

cpuandnet
Posts: 32
Joined: Thu Jan 17, 2019 6:43 am

Re: Table field: Title Row & no input

Post by cpuandnet » Thu Aug 20, 2020 10:43 pm

As dunbarx stated, it can easily be done but it is kludgy. I often use 2 scrolling list fields. One for the header and one for the data. On both fields, set the lock text to true. On the header, turn off the scrollbars. On the data field, set the list behavior property to true. Here is what one of mine looks like after a little lipstick has been applied too.

ListField.png

simon.schvartzman
Posts: 641
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Re: Table field: Title Row & no input

Post by simon.schvartzman » Thu Aug 20, 2020 10:59 pm

@craig & @cpuandnet, your suggestions are fine but things become more complicated if the header is larger than the table width (meaning there are more columns than would fit in the visible field) as is my case, and horizontal scroll is needed as well.

I'm inclined to find another workaround but anyway will submit the feature request

Many thanks for your support.
Simon
________________________________________
To ";" or not to ";" that is the question

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9665
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Table field: Title Row & no input

Post by dunbarx » Thu Aug 20, 2020 11:24 pm

Simon, I think the team is not going to commit much to this feature request. Submit anyway, though.

So you are thinking of yet additional kludges? What else would do?

Craig

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Table field: Title Row & no input

Post by Thierry » Fri Aug 21, 2020 8:36 am

Hi Simon,

May be that you will find useful this excellent tableField from Bernd
called modTableField.

Here a screenshot:

bernd-modTableField.jpg

I have version 0.2.6 and don't know if it's the latest official version.


Kind regards,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Table field: Title Row & no input

Post by bn » Fri Aug 21, 2020 10:12 am

Hi Simon,

since Thierry mentioned it:

modTableField is a table field with an api, i.e. you can instruct it to do certain things.
If you have ever used tinyDictionary then you have used modTableField. http://livecodeshare.runrev.com/stack/8 ... Dictionary

It is not as powerful as the datagrid table but still has a lot of features.
It consists of basically two fields (header and content).
But it does have a learning curve.

http://berndniggemann.on-rev.com/modTab ... _3_9_5.zip

Kind regards
Bernd

simon.schvartzman
Posts: 641
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Re: Table field: Title Row & no input

Post by simon.schvartzman » Fri Aug 21, 2020 2:05 pm

Bernd and Thierry many thanks for the hint.

Bernd it seems your modTableField will certainly comply with my requirements. Great job!

BTW, for those interested, I've submitted a feature request to LC and it can be found here

https://quality.livecode.com/show_bug.cgi?id=22874

Cheers...
Simon
________________________________________
To ";" or not to ";" that is the question

Post Reply

Return to “Talking LiveCode”