Polygrid

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Polygrid

Post by bbalmerTotalFluency » Sun Jul 14, 2024 12:12 pm

Hello:

I purchased the polygrid as part of a summer bundle. It's beautiful, fast but a bit opaque. I'd like to find some instructions specifically for searching, filtering, editing and sorting. My error may be that I am using it as an interactive thing and not a read only thing. Of course, I could use the datagrid but I find that to be heavy, slow and has a steep learning curve, which I don't enjoy because this sort of thing gets only occasional use with me.

I've looked for instructions in the livecode dictionary built in to the livecode IDE. Nothing there when I search for polygrid or widget. I've tried the online dictionary here https://milby.us/lc/docs/api.html but I see nothing for polygrid.

I've done the usual google searching and nothing comes up.

Can anyone help with a suitable source of polygrid instructions OR would you not use it for anything other than read-only data?

Bruce

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Polygrid

Post by Klaus » Sun Jul 14, 2024 12:50 pm

Hi Bruce,

see attached screenshot, click on "polygrid", there are many entries for Polygrid!
Looks like there are many ways for manipulating (searching, filtering etc.) e.g. "the TSVdata" of your widget(s).


Best

Klaus
Attachments
dictionary.jpg

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Polygrid

Post by Klaus » Sun Jul 14, 2024 1:18 pm

Maybe you have a "use-case" you could need help with?
Just post it here.

stam
Posts: 3060
Joined: Sun Jun 04, 2006 9:39 pm

Re: Polygrid

Post by stam » Mon Jul 15, 2024 2:08 am

bbalmerTotalFluency wrote:
Sun Jul 14, 2024 12:12 pm
Hello:

I purchased the polygrid as part of a summer bundle. It's beautiful, fast but a bit opaque. I'd like to find some instructions specifically for searching, filtering, editing and sorting. My error may be that I am using it as an interactive thing and not a read only thing. Of course, I could use the datagrid but I find that to be heavy, slow and has a steep learning curve, which I don't enjoy because this sort of thing gets only occasional use with me.

I've looked for instructions in the livecode dictionary built in to the livecode IDE. Nothing there when I search for polygrid or widget. I've tried the online dictionary here https://milby.us/lc/docs/api.html but I see nothing for polygrid.

I've done the usual google searching and nothing comes up.

Can anyone help with a suitable source of polygrid instructions OR would you not use it for anything other than read-only data?

Bruce
Hi Bruce,
The datagrid has a much more extensive API, hence the learning curve. It is slower than the polygrid, but I wouldn't call it "slow". It's faster than a table field when it comes to showing large amounts of data. It's very capable - the only real downside for me is that a) it's a group with some annoyances from that (eg if selected group is on, you can accidentally pick it apart) and more importantly, b) it relies on a behavior substack, which means you can't easily copy it to another stack.

The PolyGrid is quick and easy, faster than the datagrid when displaying a large amount of data, It looks very nice, but much more limited.
Its API is much more limited too, and a lot of things are a bit cryptic (such as assigning colors to text). Having said that, data-oriented tasks are similar to DG in the sense that they both use an array as the datasource (the dgText you get from a datagrid is derived from the dgData array internally).

So things like filtering, sorting etc, are usually done at the array level. Unlike the datagrid, there is no command for sorting for example.

You won't see an entry on this in the online API because that was generated a long time ago. Extensions import their documentation dynamically to the Dictionary on installation, so if you've installed it you should see it in the dictionary, but if not, you won't. I can see it, and if you have PolyGrid installed, you should too.

Alternatively you could use a Dash-compatible docset viewer (I highly recommend Dash.app on MacOS but it's a paid product - there are free alternatives). With this you can access exported dictionaries. James Hale has a shared a stack to read these on sample stacks (docset reader) and every now and again releases his own export. He's also shared a stack (make docset) to export your own dictionary to review as needed.

But as Klaus says, if any questions post them here and you'll get a rapid response...

bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Re: Polygrid

Post by bbalmerTotalFluency » Mon Jul 15, 2024 5:03 am

Hello Chaps:

Thanks for pitching in.

First off the PolyGrid instructions have now appeared in my built-in dictionary. My dictionary is VERY slow to load (which surprises me, is that normal?) and I think perhaps it had not finished loading the last time I was looking for the PolyGrid instructions.

My use case is super simple.

Vary column widths
Hide / Show columns
Sort
Filter
Find
CRUD (create,read,update,delete)

That's about it. Beneath the abilities of the dataGrid hence why I think I can get away with using the polygrid + a couple of extra fields if I need to. Plus I appreciate the aesthetics (congrats to the PolyGrid creator and apologies for using it for such a simple problem.

Bruce

stam
Posts: 3060
Joined: Sun Jun 04, 2006 9:39 pm

Re: Polygrid

Post by stam » Mon Jul 15, 2024 7:02 am

bbalmerTotalFluency wrote:
Mon Jul 15, 2024 5:03 am
My use case is super simple.

Vary column widths
Hide / Show columns
Sort
Filter
Find
CRUD (create,read,update,delete)

That's about it.
Is that all lol?

Some of what you ask can be done with built-in properties (such as pgColumnWidths/pgColumnNames), some need to be coded at array level.

Most data operations can be done with the pgData array (or possibly pgText, the equivalent of dgText), some can only be done this way: sort, filter, find.

Others cannot be done at all without kludging it, for example inline editing.

Even those that that can be done with built-in properties and/or messages can be unintuitive (for example, what one would normally expect to be a command is instead a property, such as addData). But overall once you get it working it works well.

Have a look at the API and you’ll see what is possible easily and what you need to code.

One useful thing is to review the included examples. And on that note be aware that there are many updates since release that have not been announced so if you’ve not done this already, head over to livecode.com and download the latest version. This includes many examples.

No one sadly has the bandwidth to create a full tutorial but if you’re stuck, then asking here will help…


As for slow dictionary check out Bernd’s tinyDictionary: viewtopic.php?f=93&t=39213&p=230825&hilit=bernd#p230810
This may well be a lot faster... (I personally use Dash on Mac, having exported my current dictionary to a docset using James Hale's Make Docset stack).

Post Reply