MichaelBluejay wrote: Tue Aug 19, 2025 9:54 pm
My experience is different. Scrolling a 1000x1200-pixel, 6-column DataGrid on my old Mac (i7/4GHz CPU) is pretty slow. Maybe it would be fast enough on a new Mac, but HTML tables scroll like lightning on my old computer. I can't test DataGrid on my new computer because LC won't launch.
Well that's not been my experience, even on my old Intel Mac (can't check again now as I'm abroad).
I do wonder if in fact you tested tableField rather than datagrid; the former has been proven to be slow when loading thousands of rows, the latter is orders of magnitude faster, and the new polygrid is even faster by an order of magnitude (polygrid comes with example stacks, one of which is a stack that compares tableField/datagrid/polygrid with large datasets). I should clarify that I only have experience of this for desktop apps. I haven't tested on web apps, because the whole web app process in LiveCode is not a great experience, but would not really expect a massive difference.
I have to put up my hand and say that I use different software for web apps. Specifically, I use XOJO - which makes it crazy easy to do decent database driven web apps, and have recently built a multiuser database app with an audience thousands of healthcare providers (already running and going public next month). I use XOJO because it's easy to produce professional looking interfaces coupled with fast and functional backend app - the whole thing took under 3 days to create to create and release this project.
Regarding your question that culminated in a discussion of metadata - metadata is a bad fit, unless you're using tableField (ie a text field), because you're not manipulating text, you're manipulating tables/tabular data, and you should use the right tools for the task.
Consider: With your HTML tables you are essentially adding a hidden key, so why would you not do the same with DataGrid (or PolyGrid/PolyList)?
You would just add as a hidden array key (or to put it simpler, a hidden column) so that data is always associated with the specific row and will always follow it around even if exported to other functions as an array.
In my opinion, metadata would be the wrong approach for what you are wanting to achieve.
MichaelBluejay wrote: Tue Aug 19, 2025 9:54 pm
And yeah, I did put some effort into learning DataGrid for my old LC-based accounting app, because I had to, because it was the opposite of intuitive. I I found myself constantly shaking my head at DataGrid's crazy syntax. I felt that DataGrid's difficulty went against the whole "XTalk is easy" idea. HTML/JS was way faster to learn by comparison.
I would argue
LiveCode is hard - for developers used to other languages. But once you 'grok' it, it's the nicest and easiest language out there.
Until then, it seems really quite arbitrary and illogical (that was my experience when I picked up LC properly during the pandemic but I eventually saw the light

).
The same goes for the datagrid. Once you 'grok' the API, it's really easy to do it all... but there is a learning curve to get over. It's not the easiest, but I personally don't think it's
that hard and in spite the new flashy table widgets (polyGrid and polyList) I always come back to the datagrid because of its versatility and genuinely useful API - in my mind it's a masterpiece

What I found helpful is a better LiveCode API documentation app - with a (paid) app called Dash (
https://kapeli.com/dash). It greatly simplifies searching the datagrid API and is extremely useful for pretty much
every possible programming language. I can't recommend highly enough, no matter which language you use.
MichaelBluejay wrote: Tue Aug 19, 2025 9:54 pm
I'm sure that's true though I haven't run across anything in HTML/JS that I felt was a lot easier in LC. I know, for example, that LC can refer to "words" of text, which is convenient, but I don't really use that feature. What other kinds of things are easier in LC vs. JS?
To use the example from the mothership's site:
LiveCode
Code: Select all
sort lines of theText descending by last item of each
Javascript
Code: Select all
theText = theText.split("\n");
theText = theText.sort(sort_item_3).join("\n");
function sort_item_3(line1, line2){
line1 = line1.split(",");
line2 = line2.split(",");
if(line1[2] == line2[2]) return 0;
else if(line1[2] > line2[2]) return -1;
else return 1;
}
A more complex example: Walk a given directory tree and print files matching a given pattern (recursive, so it includes subfolders)
LiveCode
Code: Select all
function pathsForDirectoryAndWildcardPattern pDirectory, pWildcardPattern
filter files(pDirectory) with pWildcardPattern
repeat for each line tFile in it
put pDirectory & slash & tFile & cr after tPaths
end repeat
filter folders(pDirectory) without ".."
repeat for each line tFolder in it
put pathsForDirectoryAndWildcardPattern(pDirectory & slash & tFolder, pWildcardPattern) after tPaths
end repeat
return tPaths
end pathsForDirectoryAndWildcardPattern
Javascript
Code: Select all
var fso = new ActiveXObject("Scripting.FileSystemObject");
function walkDirectoryTree(folder, folder_name, re_pattern) {
WScript.Echo("Files in " + folder_name + " matching '" + re_pattern + "':");
walkDirectoryFilter(folder.files, re_pattern);
var subfolders = folder.SubFolders;
WScript.Echo("Folders in " + folder_name + " matching '" + re_pattern + "':");
walkDirectoryFilter(subfolders, re_pattern);
WScript.Echo();
var en = new Enumerator(subfolders);
while (! en.atEnd()) {
var subfolder = en.item();
walkDirectoryTree(subfolder, folder_name + "/" + subfolder.name, re_pattern);
en.moveNext();
}
}
function walkDirectoryFilter(items, re_pattern) {
var e = new Enumerator(items);
while (! e.atEnd()) {
var item = e.item();
if (item.name.match(re_pattern))
WScript.Echo(item.name);
e.moveNext();
}
}
walkDirectoryTree(dir, dir.name, '\\.txt$');
JS
is a very functional language, but for me, LiveCode is just easier, more succinct and more pleasant. I just wish their web offering was more like XOJO...