I have sample PolyGrid with 6 columns and this code returns the correct column type for columns 1,2, &3. But returns blank for column's 4 thru 6. Perhaps this is a know issue getting past column #3?
on mouseup
ask "Which column do you want to know the type?"
put it into tColumnNumber
set the pgInternalPointer of widget "polygrid1" to tColumnNumber
put the pgContentTypeofColumn of widget "polygrid1" into tTypeOfColumn
answer tTypeOfColumn
end mouseup
thanks
Lance
PolyGrid pgContentTypeOfColumn
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: PolyGrid pgContentTypeOfColumn
Hi Lance,
I cannot get the sample code from the documentation to work if the number of rows is smaller than the number of columns.
That means if I ask for the "contentType" of a column 5 in a polygrid with 6 columns but only 2 rows it returns empty. But for column 1 and 2 it returns "text" which is correct.
In other words if you want to know the "pgContentTypeofColumn" for column 5 your Polygrid has to have at least five rows.
I consider this a bug.
However this code works for any number of rows.
Kind regards
Bernd
I cannot get the sample code from the documentation to work if the number of rows is smaller than the number of columns.
Code: Select all
on mouseUp
local tTypeOfColumn
# The following code shows how to get the content type of column number 5.
set the pgInternalPointer of widget"PolyGrid" to "5" --> Column 5
put the pgContentTypeofColumn of widget"PolyGrid" into tTypeOfColumn --> text, svg-lcname,...
end mouseUp
In other words if you want to know the "pgContentTypeofColumn" for column 5 your Polygrid has to have at least five rows.
I consider this a bug.
However this code works for any number of rows.
Code: Select all
on mouseup
ask "Which column do you want to know the type?"
put it into tColumnNumber
put the pgColumns of widget "PolyGrid1" into tColumnsInfo
put tColumnsInfo[tColumnNumber]["contenttype"] into tTypeOfColumn
answer tTypeOfColumn
end mouseup
Bernd
Re: PolyGrid pgContentTypeOfColumn
Hello Bernd,
Thanks for confirming what I was getting and your approach worked perfectly and solved the issue.
Much appreciated.
Lance
Thanks for confirming what I was getting and your approach worked perfectly and solved the issue.
Much appreciated.
Lance