Page 1 of 1
Datagrid (Form)
Posted: Fri Aug 10, 2012 7:03 am
by pidobearBUSsb9q
Hi guys
I have put 3 images per rows for the template in a Datagrid
i got 1 custom property for each of there that contain a value(int)
how can i put those value in?
will the values of the custon property be the same in the datagrid if i got multiple rows
and it seem like i have a problem getting custom property from a image in a datagrid
THanks
Re: Datagrid (Form)
Posted: Fri Aug 10, 2012 11:56 am
by Klaus
Hi guy
we need more info!
How do you put the imafges into the grid? Copy the image to new image objects in the grid or as icons in buttons?
Where are the images with the custom properties located, how do you reference them in the grid?
What did you script so far?
Questions, questions, questions
Best
Klaus
Re: Datagrid (Form)
Posted: Mon Aug 13, 2012 2:44 am
by pidobearBUSsb9q
i am so sorry i am really confused with this too, still new to grid. so i do not know how to give a really good explanation.
be patient with me thanks
i put the image object in the grid as a template
i did a RSS reader which grab the picture at the start but i cant get it to retrieve the info.
this is how i put inside the array
Code: Select all
put 0 into hello
repeat for each line theLine in allItems
if hello <= 3 then
add 1 to hello
add 1 to A
put the customproperties[theLine] of this stack into theItem
put theItem["thumbnail"] into theDataA[A]["Image URL"]
else if hello <= 7 then
add 1 to hello
add 1 to B
put the customproperties[theLine] of this stack into theItem
put theItem["thumbnail"] into theDataA[B]["Image URL2"]
else
add 1 to hello
add 1 to C
put the customproperties[theLine] of this stack into theItem
put theItem["thumbnail"] into theDataA[C]["Image URL3"]
end if
end repeat
set the dgData of group "DataGrid 1" to theDataA
//set the htmltext of field "title" to theOutput
error revXMLText(theID)
revDeleteXMLTree theID
error "End of all Errors"
//select line 1 of field "title"
send selectionChanged to group "DataGrid 1"
end mouseUp
this is how i am trying to retrieve it
Code: Select all
on selectionchanged
put "item_" & [b]word 2 of the selectedLine of me[/b] into theLine <------ i need to grab this but i dont know how to grab from the image.i think i lack this part only and i am done
put the customproperties[theLine] of this stack into theItem
if theItem["content"] <> "" then
put theItem["content"] & return after theOutput
else
put theItem["description"] & return after theOutput
end if
if theItem["pubDate"] <> "" then
put "<p>Published on:" && theItem["pubDate"] & "</p>" & return after theOutput
end if
if theItem["author"] <> "" then
put "<p>author:" && theItem["author"] & "</p>" & return after theOutput
else if theItem["creator"] <> "" then
put "<p>author:" && theItem["creator"] & "</p>" & return after theOutput
end if
if theItem["link"] <> "" then
put "<p><a href=" & quote & theItem["link"] & quote & ">Click here to view Webpage</a></p>" & return after theOutput
end if
set the htmltext of field "fieldText" to theOutput
end selectionchanged
thanks
Re: Datagrid (Form)
Posted: Mon Aug 13, 2012 3:23 pm
by Klaus
Hi,
still not sure if I understand, but it looks like you want to add the image to the htmltext, right?
Well, then you need to create the correct HTML tag for this
Try this:
Code: Select all
...
if theItem["link"] <> "" then
put "<p><a href=" & quote & theItem["link"] & quote & ">Click here to view Webpage</a></p>" & return after theOutput
end if
## Preview image here:
if theItem["thumbnail"] <> "" then
put "<p><img src=" & quote & theItem["thumbnail"] & quote & "></p>" & return after theOutput
end if
set the htmltext...
...
Hint:
Create this little function, put in your stack script(s) and be happy:
Code: Select all
function q TheString
return QUOTE & theString & QUOTE
end q
Will save a LOT of typing:
...
put "<p><a href=" & q(theItem["link"]) & "</p>" & return after theOutput
...
Best
Klaus
Re: Datagrid (Form)
Posted: Tue Aug 14, 2012 2:25 am
by pidobearBUSsb9q
hi thanks for replying
that is something i have been looking for too but not what i want now thank anyway.
Previous version which select line to view different contents:
new version which user select image to view different contents:
i use this line to grab the content in the previous version:
put "item_" &
word 2 of the selectedLine of me into theLine <------ i need to grab this but i dont know how to grab from the image.i think i lack this part only and i am done
but i do not know how to get the line from the image and i need to know how.
and how to i get the individual image in different rows inside the datagrid to respond as i cant set the setting as they are auto generated. Example: i selected image 1 from the 3rd row.

Re: Datagrid (Form)
Posted: Thu Aug 16, 2012 2:29 am
by pidobearBUSsb9q
Anyone can help with this problem?
Re: Datagrid (Form)
Posted: Thu Aug 16, 2012 11:40 am
by Klaus
Hi,
since you have 3 images in ONE row, "the selectedline" will only give you the LINE nr. where the 3 images reside
but not the number of the selected/clicked image!
So you might need to script a "mouseup" handler for the images, so you know WHICH image has been clicked.
But to be honest, I am still not sure what you are after...
Best
Klaus