CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 On click grid row - get data values

Print topic Send  topic

Author Message
johnsantana

Posts: 2
Posted: 09/26/2014, 11:26 AM

This is probably very basic, but I have not found the answer on the forum or in the help docs.

I have a data grid set up, and I want to trigger a javascript function when the user clicks a row on the grid, using a value in the grid as a parameter to the function.

Can't figure out how to get data values from a clicked row.

Can someone fill me in?

_________________
Thanks,
JS
View profile  Send private message
clickryan


Posts: 55
Posted: 09/26/2014, 3:39 PM

You can use querystring or javascript.
_________________
Codecharge Developer (PHP, ASP.net - C# or VB.net)
for help or inquiries please visit clickryan.com
View profile  Send private message
andrewi

Posts: 162
Posted: 09/28/2014, 5:27 AM

Hi John,

Use HTML view and try using CCS attributes.

Say you have your javascript called by an onclick event:

onclick="Javascript:myFunction();"

Right-click in between the parentheses and from the pop-up menu choose "Insert attribute...". You can choose from a variety of Source Type, but to take data from the grid, choose "Datasource Column". Select the column you want for "Source Name". You've also got to give the attribute a name - any unique name will do.

The link will look something like this:

onclick="Javascript:myFunction({linkImage:link_id});"

The attribute is in braces; the part before the colon is the scope of the attribute, and it will be the name of the parent control or form. The part after the colon is the unique name that you entered.

When the page is rendered the attribute will be populated with the current value of the column for that row. If the attribute is a string value you have to quote it yourself, for example with single quotation marks as below:

onclick="Javascript:myFunction('{linkImage:link_id}');"

see documentation here http://docs.codecharge.com/studio50/html/UserGuide/Cont...ibutes.html?toc
View profile  Send private message
johnsantana

Posts: 2
Posted: 09/28/2014, 11:36 PM

Hi,

Thanks SO MUCH for your detailed reply. This looks like exactly what I'm looking for and I will give it a try first thing tomorrow.

JS
_________________
Thanks,
JS
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.