473,796 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Integrating Ext 2.0 and Dojo 1.0

2 New Member
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
Jan 10 '08 #1
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.
Jan 10 '08 #2
ygjyothi
2 New Member
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.

Expand|Select|Wrap|Line Numbers
  1.   /**Ext Code
  2.      * Returns the values of the selected entry in an array.
  3.      */
  4.     getSelected: function() {
  5.         var selectedRow = [];
  6.         var record = this.getSelectionModel().getSelected();
  7.         var columnNames = this.tableDetails.column;
  8.  
  9.         if (record == null) {
  10.             return selectedRow;
  11.         }
  12.         for (var i = 0; i < columnNames.length; i++) {
  13.             selectedRow.push(record.get(columnNames[i]));
  14.         }
  15.  
  16.         return selectedRow;
  17.     },
  18.  
  19.     /**Ext Code
  20.      * Returns the values of the selected entries in a two 
  21.      * dimentional array.
  22.      */
  23.     getSelections: function() {
  24.         var selectedRows = [];
  25.         var records = this.getSelectionModel().getSelections();
  26.         var columnNames = this.tableDetails.column;
  27.  
  28.         if (records == null) {
  29.             return selectedRows;
  30.         }
  31.         for (var i = 0; i < records.length; i++) {
  32.             var selectedRow = [];
  33.             var record = records[i];
  34.             for (var j = 0; j < columnNames.length; j++) {
  35.                 selectedRow.push(record.get(columnNames[j]));
  36.             }
  37.             selectedRows.push(selectedRow);
  38.         }
  39.  
  40.         return selectedRows;
  41.     },

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.


Expand|Select|Wrap|Line Numbers
  1. dojo.require("dojox.charting.Chart2D");
  2. dojo.require("dojox.charting.themes.PlotKit.purple");
  3.  
  4.  
  5. makeObjects = function(){
  6.     var chart1 = new dojox.charting.Chart2D("test");
  7.     chart1.addPlot("default", {type: "Areas"});
  8.     chart1.addAxis("x", {fixLower: "minor", fixUpper: "major"});
  9.     chart1.addAxis("y", {vertical: true, fixLower: "minor", fixUpper: "minor"});
  10.     chart1.setTheme(dojox.charting.themes.PlotKit.purple);
  11.     chart1.addSeries("Series A", [1, 2, 3, 1, 5, 2, 10]); /*Currently hardcoded*/
  12.     chart1.render();
  13. };
  14.  
  15. makeDynamicObjects = function(){
  16.     chart = new dojox.charting.Chart2D("test");
  17.     chart.addPlot("default", {type: "Areas"});
  18.        chart.addAxis("x", {fixLower: "minor", fixUpper: "minor", natural: true});
  19.     chart.addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", includeZero: true});
  20.     chart.setTheme(dojox.charting.themes.PlotKit.purple);
  21.     chart.addSeries("Series A", makeSeries(2));/*Currently hardcoded*/
  22.     chart.render();
  23.     setInterval("updateTest()", 1000);
  24. };
  25.  
  26. makeSeries = function(len){
  27.     var s = [];
  28.     while(s.length-1!=len)
  29.         s.push((Math.random()*25+1));
  30.     return s;
  31. }
  32.  
  33. updateTest = function(){
  34.     updateChart(chart, makeSeries(3));
  35. }
  36.  
  37. updateChart = function(chart /* Chart Object */, newData /* Array */){
  38.   var i = 0;
  39.     dojo.forEach(chart.series, function(s) {
  40.         s.data.shift(); //remove oldest data
  41.         s.data.push(newData[i++]);
  42.     });
  43.     chart.render();
  44. }
  45. dojo.addOnLoad(makeObjects);
  46. dojo.addOnLoad(makeDynamicObjects);
Please tell me how to pass the array values from Ext to Dojo.
Jan 11 '08 #3
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:
Expand|Select|Wrap|Line Numbers
  1. chart1.addSeries("Series A", extArr);
Jan 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1757
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.
2
4521
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.
15
13407
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...
7
6966
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>
5
9975
by: gaya3 | last post by:
Hi, can anyone find error in the following example <%@ include file="JspBean.jsp" %> <%@ page import="java.util.*"%> <html> <head> <%
2
1870
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
1
3975
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
1
3320
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> ...
0
9530
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,...
0
10459
Oralloy
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...
0
10236
jinu1996
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...
1
10182
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,...
0
9055
agi2029
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...
1
7552
isladogs
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...
0
6793
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();...
0
5445
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...
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.