Mar 9th, 2012, 1:19 AM
(Jul 13th, 2011, 9:47 AM)Ben Wrote: Hi Rui,
Interesting! I'm just playing around with the Google Chart Tools myself right now.
Quote:I want to replace the data.setvalue of "100" for the value of a particular column of the database. Is it possible to help me?
I won't fib, this is very complicated to explain over the forums - this is a sit-down-in-person sort of a problem. But here's a few tips.
The list of column name and submission data is only passed to the Export Type Smarty template not the Export Group Smarty template. So if you need to access that information, your javascript code will either need to be executed in that section, or dynamically pull that value from the markup generated by the Export Type template on page load. Since the existing code you pasted is told to execute when the page is loaded, I'd be tempted to give the column name <td>'s generated by the Export Type template an ID/Class which you could access on load. Similarly, if your goal is to graph the data that's outputted to the page, the JS code would parse the entire table and populate the Google DataTable accordingly.
That's how I would tackle it. It would make the page load slightly slower since there'd be a lot of DOM parsing on page load, but it wouldn't require you to duplicate any Smarty Loops to output the required javascript as well as the actual page data.
Quote:2 - A simpler question. The link at the top of page for updates is very useful, but I would that only appear with the administrator user. It is possible to hide this link for final customer accounts?
Good question...! No, this can't be done with 2.0.x, but you *can* with 2.1.0. The latest version of the module was written to support 2.1.0 and it includes the option to map Export Groups to specific client accounts. Thus, you could create a second "HTML/Printer Friendly" Export Group containing only a single Export Type and assign that to the user. Bit of a hack, but it would work. Also, 2.1.0 is still in Beta and has a few remaining issues to iron out. It should be the main build in a couple of months or so.
Alternatively, I suppose you could check to see what the account ID is directly in the template... let me know if you're interested in this and I'll look through the code.
Quote:3 - What seems to be a bug. Whenever I want to add a new export type to export group (eg html - print) the link takes me the page to create new group and not to a new export type.
That does sound like a bug! What version of the module + browser + OS are you using?
- Ben
Thank you for finally solved my problem!