Hi All,
I'm trying to integrate Ext2.0 and Dojo 1.0 i.e the selected rows from a Ext 2.0 Grid upon a button click should generate a Dojo 1.0 Chart in a pop up window or Ext.window.Ther e is a Ext 2.0 Grid which gets values from the database. When the user selects some rows and gives a request for Graphical view by clicking a Ext button or Ext handler, a Dojo 1.0 Chart must be generated for the selected rows in the Ext window (pop up window). The Chart should take the Row headers and column headers as X and Y axis.
I tried many ways to pass the data but it is not happening ....can anyone help me in this regard with code ....
Thanks & Regards
Jyothi
3 2288 acoder 16,027
Recognized Expert Moderator MVP
Hi Jyothi, welcome to TSDN!
I've not used either of Ext or Dojo, but if you post your code and the format that the data should take, either myself or someone else may be able to help you.
This is the Ext code in which getSelected is a function that returns a record i.e the selected entry in an array and the getSelections is a function that returns an array of records i.e a two dimentional array. - /**Ext Code
-
* Returns the values of the selected entry in an array.
-
*/
-
getSelected: function() {
-
var selectedRow = [];
-
var record = this.getSelectionModel().getSelected();
-
var columnNames = this.tableDetails.column;
-
-
if (record == null) {
-
return selectedRow;
-
}
-
for (var i = 0; i < columnNames.length; i++) {
-
selectedRow.push(record.get(columnNames[i]));
-
}
-
-
return selectedRow;
-
},
-
-
/**Ext Code
-
* Returns the values of the selected entries in a two
-
* dimentional array.
-
*/
-
getSelections: function() {
-
var selectedRows = [];
-
var records = this.getSelectionModel().getSelections();
-
var columnNames = this.tableDetails.column;
-
-
if (records == null) {
-
return selectedRows;
-
}
-
for (var i = 0; i < records.length; i++) {
-
var selectedRow = [];
-
var record = records[i];
-
for (var j = 0; j < columnNames.length; j++) {
-
selectedRow.push(record.get(columnNames[j]));
-
}
-
selectedRows.push(selectedRow);
-
}
-
-
return selectedRows;
-
},
The dojo which geterates the chart should take these values as input in the addseries() function which take an array as input. The headers in the Ext grid/Ext table should be the X and Y axis of the Dojo Chart/Graph. Both use Javascript. - dojo.require("dojox.charting.Chart2D");
-
dojo.require("dojox.charting.themes.PlotKit.purple");
-
-
-
makeObjects = function(){
-
var chart1 = new dojox.charting.Chart2D("test");
-
chart1.addPlot("default", {type: "Areas"});
-
chart1.addAxis("x", {fixLower: "minor", fixUpper: "major"});
-
chart1.addAxis("y", {vertical: true, fixLower: "minor", fixUpper: "minor"});
-
chart1.setTheme(dojox.charting.themes.PlotKit.purple);
-
chart1.addSeries("Series A", [1, 2, 3, 1, 5, 2, 10]); /*Currently hardcoded*/
-
chart1.render();
-
};
-
-
makeDynamicObjects = function(){
-
chart = new dojox.charting.Chart2D("test");
-
chart.addPlot("default", {type: "Areas"});
-
chart.addAxis("x", {fixLower: "minor", fixUpper: "minor", natural: true});
-
chart.addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", includeZero: true});
-
chart.setTheme(dojox.charting.themes.PlotKit.purple);
-
chart.addSeries("Series A", makeSeries(2));/*Currently hardcoded*/
-
chart.render();
-
setInterval("updateTest()", 1000);
-
};
-
-
makeSeries = function(len){
-
var s = [];
-
while(s.length-1!=len)
-
s.push((Math.random()*25+1));
-
return s;
-
}
-
-
updateTest = function(){
-
updateChart(chart, makeSeries(3));
-
}
-
-
updateChart = function(chart /* Chart Object */, newData /* Array */){
-
var i = 0;
-
dojo.forEach(chart.series, function(s) {
-
s.data.shift(); //remove oldest data
-
s.data.push(newData[i++]);
-
});
-
chart.render();
-
}
-
dojo.addOnLoad(makeObjects);
-
dojo.addOnLoad(makeDynamicObjects);
Please tell me how to pass the array values from Ext to Dojo. acoder 16,027
Recognized Expert Moderator MVP
Set the result of the Ext function to a variable, e.g. var extArr = ..., then pass this to the addSeries method: - chart1.addSeries("Series A", extArr);
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: drosensnap |
last post by:
Hi. Sorry to ask Dojo questions here, but otherwise I have to use
their email group, which seems more embarrasing :)
Does anyone know how to CHANGE the title of tree node using the Dojo
Toolkit? I can change the title using
thatLittleNode.title = 'the new title';
which changes the title on the object, but it doesn't show up on the
UI.
|
by: Roger (Bordeaux) |
last post by:
Hello everybody,
I try to use the dojo datepicker and dropdowndatepicker widgets and I
have the following problems.
The setDate methode does not modify the display.
The storedDate property stay undefined for the dropdowndatepicker
I want to initialise the date field from a MySql database but I don't
see how to achieve it.
|
by: plsHelpMe |
last post by:
Hi All,
I am having a problem. I am using DOJO toolkits to fetch some data on my webpage. Now suppose if i leave my webpage for some time and the session gets expired and then i try to click on the link which invokes the DOJO(AJAX) call, it tries to re-authenticate and establish a session by itself. But, it then forwards me the authentication JSP as result of DOJO call instead of the intended JSP. PLease let me know how to track if the...
|
by: raknin |
last post by:
Hi,
Hi,
Now that I am handle the way of use the dojo combobox I moving to the next stage. What I want to do is updating a second combobox automatically when a value is selected in the first combobox. I have a php that can handle the server side. Any suggestion how it can be done with dojo.
I believe the code below can help other to start a dojo combobox.
Please find my dojo code:
<head>
|
by: gaya3 |
last post by:
Hi,
can anyone find error in the following example
<%@ include file="JspBean.jsp" %>
<%@ page import="java.util.*"%>
<html>
<head>
<%
| |
by: pincopallo_it |
last post by:
I started using dojo for my AJAX application .
i need really a selectbox which read a json file and that with the
onchange() modify a second select box.
I tried using the filtering select of dojo but i get errors noone can
explain me in dojo forums !
Is there a javascript ajax framework which has more documentation and
which i can use it to change my second select box ?
Thanks
|
by: kokababu |
last post by:
I am trying to load dojo module from different domain; such as dojo.parser, dijit.form.TextBox etc.
<html>
<head>
<script type="text/javascript">
djConfig = {
isDebug: true,
parseOnLoad: true,
xdWaitSeconds: 10
|
by: ashutoshjoshi10 |
last post by:
Hi,
I am using a Dijit.form.filteringSelect to display values using the dojox.data.QueryReadStore. But, after overriding _filterResponse() to format the data in a Dojo-parsable format, whatever value I select gets bypassed and the only value that gets selected is the the first one on the list. I am using the following code…please let me know if what I am missing here.
Thanks much in advance!
<html>
<head>
...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |