Search Results

Search found 97 results on 4 pages for 'dijit'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Dojox grid having problem with Contentpane

    - by ice
    the grid appears properly on template's first loading. But when you click the paging button to load flooders.php thru list_result1() only the paging buttons will appear. I already tested the flooders.php outside the template and it works properly. what seems to be the problem? and what are the tools that i can use to see if the javascript is loading properly because i think the error console of ff browser which i use to track errors won't give you that much info when you are working with contentpane. thanks! ice note: below are the codes... ** from contentpane js function list_result1(){ args=""; uri = "flooders.php" + args; dojo.xhrGet( { url: uri, handleAs: "text", timeout: 500, // Time in milliseconds load: function(response, ioArgs) { //alert(response); dojo.byId("flooders_table").innerHTML = response; return response; }, // The ERROR function will be called in an error case. error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } }); //end of dojo.xhrGet } **flooders.php starts here*** @import "js/dojo-0.9.0/dojo/resources/dojo.css"; @import "js/dojo-0.9.0/dijit/themes/tundra/tundra.css"; @import "js/dojo-0.9.0/dijit/themes/tundra/tundra_rtl.css"; @import "css/ash.css"; @import "js/dojo-0.9.0/dojox/grid/resources/Grid.css"; @import "js/dojo-0.9.0/dojox/grid/resources/tundraGrid.css"; @import "js/dojo-0.9.0/dojo/resources/dojo.css"; @import "js/dojo-0.9.0/dijit/tests/css/dijitTests.css"; .dojoxGridRowEditing td { background-color: #F4FFF4; } .dojoxGrid input, .dojoxGrid select, .dojoxGrid textarea { margin: 0; padding: 0; border-style: none; width: 100%; font-size: 100%; font-family: inherit; } .dojoxGrid input { } .dojoxGrid select { } .dojoxGrid textarea { } #controls { padding: 0px 0; } #controls button { margin-left: 10px; } .myGrid { width: 550px; height: 230px; margin-left: 20px; /* border: 1px solid silver; */ } echo " // it has script heading here (function(){ // some sample data // global var 'data' data = { identifier: 'id', label: 'id', items: [] }; data_list = [ $banlist ]; var rows = $listnum ; var x=1; for(var i=0, l=data_list.length; i // global var 'test_store' test_store = new dojo.data.ItemFileWriteStore({data: data}); })(); // it has ending here "; ?   -- here's the javascript dojo.require("dijit.TitlePane"); dojo.require("dijit.dijit"); dojo.require("dojox.grid.DataGrid"); dojo.require("dojo.data.ItemFileWriteStore"); dojo.require("dojo.parser"); // scan page for widgets and instantiate them dojo.require("dijit.layout.LayoutContainer"); dojo.require("dijit.layout.AccordionContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.TabContainer"); dojo.require("dijit.Editor"); dojo.require("dijit._editor.plugins.AlwaysShowToolbar"); dojo.require("dijit._editor.plugins.LinkDialog"); //this must be inlcuded below function() selectCell = { styles: 'text-align: center;', type: dojox.grid.cells.Select }; gridLayout = { defaultCell: { width: 5, styles: 'text-align: right;' }, rows: [ [ { name: 'Mark', width: 3, field: 'col1', editable: true, styles: 'text-align: center;', type: dojox.grid.cells.Bool }, { name: 'Id', width: 3, field: 'id' , editable: false }, { name: 'Username', field: 'col2', editable: false, styles: '', width: '70%' }, { name: 'Reason', field: 'col3', editable: false , styles: '', width: '100%' }, { name: 'Date Banned', field: 'col4', editable: false , styles: '', width: '70%' } ] ] };

    Read the article

  • Dojo: Programatically setting checkbox label for adding on TableContainer

    - by Det
    Hi there, after some hours of checking out documentation, I am somewhat desperate: Basically I need to populate a TabContainer with some TextBoxes, and some Checkboxes. All theses neatly arranged: Labels to the left, fields to the right. To have this done I use a TableContainer that I add to the TabContainer, create the TextFields and add them to the TableContainer. All is rendered ok. But when it comes to a checkbox, I can't find the trick to have a label displayed at all. If I: - add a label-attribute to creation statement say: var text8 = new dijit.form.CheckBox({ id:"zuschauer_" + i, value: "zuschauer", label:"fritt"}); Firefox comes up with a "containerNode is null" - Error try to add a tag: Nothing is shown (no error, but alas: no label): var text9 = dojo.create('<label>'); dojo.attr(text9,"for","zuschauer_" + i); dojo.attr(text9,"content","fritt"); try to add a div or somewhat else on the tablecontainer (disabled Labels): Firefox comes up whith: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.appendChild]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: ... same is for created TextNodes... So how the hack: - Would I generate a label to a checkbox programatically (no html template possible, I've seen the code around, creating a checkbox but having a 'label for' on the html before. This would not be helpful, as I don't know how many checkboxes I need at designtime. These are to be genereated completly at runtime. - Would I have this very simple design done programatically, Must be easy, this is not rocket sience. Do I really need the TableContainer to have this done? - Can I create static text in a TableContainer? Any hint would be helpful Desperate Det

    Read the article

  • Dojo: Setting a CheckBox label programmatically

    - by Mitchell Flaherty
    Let me preface by saying that I saw this other question on the subject of CheckBox labels that was asked and answered well over a year ago. I was confused by the answers and am hoping that someone can clarify or that there has been new dojo functionality introduced since then that allows me to do this without resorting to HTML. So without further ado, I would like to know how to programmatically create labels for check boxes. I have a check box like so: this.pubBoxId = new dijit.form.CheckBox({ label: "IdChannel", checked: false, channel: that.idChannel }, that.name + "_PBI"); As you can see I've tried to edit the "label" field, but the label never actually shows up on the page. I have multiple CheckBoxes that I am adding to a ContentPane and simply want a label to the left or right of the check box. Is there any way I can do this without having to write separate HTML? Also, making a separate ContentPane for each individual label would be a big pain because of how many CheckBoxes I plan to have. Thank you for reading, and let me know if further clarification is needed!

    Read the article

  • Why can't multiple programmatically generated FilteringSelect's share a single store?

    - by yarmiganosca
    Before you ask, a MultiSelect wouldn't really be intuitive for the user in this instance. I have an object, with an array as its value for 'items', that's provided on the page in a var statement. I also have a function that generates and places dijit.form.FilteringSelects and is triggered on a certain button's click event. Every one of these selects should have the aformentioned object as their 'store' attribute. If I write store: new dojo.data.ItemFileReadStore({ data: object_name }), in my select initialization code, I get weird behavior: I click the generate button 2 times and get 2 FilteringSelects (call them A,B). I click on B's dropdown piece, and the menu appears attached to B. Then I click on A's dropdown button, and menu appears attached to A. If I then go back and click on B's dropdown button again, nothing happens (well not nothing; an error gets thrown). However, if instead, I have data: {items: array_literal} everything works fine, and I switch back and forth between the 2 as much as I want. As the data: statement appears once in the javascript code, this isn't a big deal (now that I have a workaround at least). It is however, exceedingly odd. I attempted to dig into the source code, to no avail.Anybody have any idea what's going on here?

    Read the article

  • Dojox Datagrid contains data, but shows up as empty

    - by Vivek
    I'd really appreciate any help on this. There is this Dojox Datagrid that I'm creating programatically and supplying JSON data. As of now, I'm creating this data within JavaScript itself. Please refer to the below code sample. var upgradeStageStructure =[{ cells:[ { field: "stage", name: "Stage", width: "50%", styles: 'text-align: left;' }, { field:"status", name: "Status", width: "50%", styles: 'text-align: left;' } ] }]; var upgradeStageData = [ {id:1, stage: "Preparation", status: "Complete"}, {id:2, stage: "Formatting", status: "Complete"}, {id:3, stage: "OS Installation", status: "Complete"}, {id:4, stage: "OS Post-Installation", status: "In Progress"}, {id:5, stage: "Application Installation", status: "Not Started"}, {id:6, stage: "Application Post-Installation", status: "Not Started"} ]; var stagestore = new dojo.data.ItemFileReadStore({data:{identifier:"id", items: upgradeStageData}}); var upgradeStatusGrid = new dojox.grid.DataGrid({ autoHeight: true, style: "width:400px;padding:0em;margin:0em;", store: stagestore, clientSort: false, rowSelector: '20px', structure: upgradeStageStructure, columnReordering: false, selectable: false, singleClickEdit: false, selectionMode: 'none', loadingMessage: 'Loading Upgrade Stages', noDataMessage:'There is no data', errorMessage: 'Failed to load Upgrade Status' }); dojo.byId('progressIndicator').innerHTML=''; dojo.byId('progressIndicator').appendChild(upgradeStatusGrid.domNode); upgradeStatusGrid.startup(); The problem is that I am not seeing anything within the grid upon display (no headers, no data). But I know for sure that the data in the grid does exist and the grid is properly initialized, because I called alert (grid.domNode.innerHTML);. The resultant HTML that is thrown up does show a table containing header rows and the above data. This link contains an image which illustrates what I'm seeing when I display the page. (Can't post images since my account is new here) As you may notice, there are 6 rows for 6 pieces of data I have created but the grid is a mess. Please help out if you think you know what could be going wrong. Thanks in advance, Viv

    Read the article

  • Dojo dialog, the iPad and the virtual keyboard issue

    - by Chris Butler
    Recently, I have been working on a project where the interface should work for desktop and tablets (in particular the iPad). One issue I am coming across is with a Dojo dialog on the iPad when text entry is taking place. Basically here is what happens: Load Dojo interface with buttons on iPad - OK Press button (touch) to show dialog (90% height and width) - OK Click on text box (touch) like DateTextBox or TimeTextBox - OK, the virtual keyboard is opened Click the date or time I want in the UI (touch) - OK, but I can't see all of the options since it is longer than the screen size... Try to scroll down (swipe up with two fingers or click 'next' in the keyboard) - not OK and the dialog repositions itself to have it's top at the top of the viewport area. Basically, the issue is that the dialog keeps trying to reposition itself. Am I able to stop dialog resizing and positioning if I catch the window onResize events? Does anyone else have this issue with the iPad and Dojo dialogs? Also, I found this StackOverflow topic on detecting the virtual keyboard, but it wasn't much help in this case... http://stackoverflow.com/questions/2593139/ipad-web-app-detect-virtual-keyboard-using-javascript-in-safari Thanks!

    Read the article

  • Dojo Lightbox Close Button

    - by gggggggg
    Hello, I have Dojo 1.4, and the lightbox is working. But the close button doesnt work with IE, I can see it, just not click it. With Firefox it workes all ok. So I assume the code and css are all ok. Any ideas? Greg

    Read the article

  • TabContainer in BorderContainer not showing correctly

    - by Stefaan
    Hi, I am using a borderContainer with a fix width and centering in the center of my page (Use of a div around the bordercontainer). Everything works fine until i add a TabContainer. All of a sudden i can not see my Tab's anymore. This goes as wel for IE as FF. Is this a bug or something else? How could i work around this? I'm using the latest release of dojo 1.4.3. I've tried using borderContainer in borderContainer with no result. Thnx Stefaan

    Read the article

  • Issue on dojo onlick event on html button

    - by Cuong Le
    I am a new kid with dojo, I got weird issue which I take lots of time and have not yet found out, assume I have 4 buttons: <button id="btnMoveFirst" data-dojo-type="dijit.form.Button" iconclass="plusIcon"> &lt; &lt;</button> <button id="btnMovePrev" data-dojo-type="dijit.form.Button" iconclass="plusIcon"> &lt;</button> <button id="btnMoveNext" data-dojo-type="dijit.form.Button" iconclass="plusIcon"> &gt;</button> <button id="btnMoveLast" data-dojo-type="dijit.form.Button" iconclass="plusIcon"> &gt; &gt;</button> And use dojo with event onclick as below: dojo.connect(dijit.registry.byId('btnMoveFirst'), "onclick", function(evt){ alert('test1'); }); dojo.connect(dijit.registry.byId('btnMovePrev'), "onclick", function(evt){ alert('test2'); }); dojo.connect(dijit.registry.byId('btnMoveNext'), "onclick", function(evt){ alert('test3'); }); dojo.connect(dijit.registry.byId('btnMoveLast'), "onclick", function(evt){ alert('test4'); }); But when I click any one of 4 buttons, or even any button in form, I got 4 alerts instead of only correct one. Does anyone know this?

    Read the article

  • dojo layout tutorial dor version 1.7 doesn't work for 1.7.2

    - by Sheena
    This is sortof a continuation to dojo1.7 layout acting screwy. So I made some working widgets and tested them out, i then tried altering my work using the tutorial at http://dojotoolkit.org/documentation/tutorials/1.7/dijit_layout/ to make the layout nice. After failing at that in many interesting ways (thus my last question) I started on a new path. My plan is now to implement the layout tutorial example and then stick in my widgets. For some reason even following the tutorial wont work... everything loads then disappears and I'm left with a blank browser window. Any ideas? It just struck me that it could be browser compatibility issues, I'm working on Firefox 13.0.1. As far as I know Dojo is supposed to be compatible with this... anyway, have some code: HTML: <body class="claro"> <div id="appLayout" class="demoLayout" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline'"> <div class="centerPanel" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'"> <div> <h4>Group 1 Content</h4> <p>stuff</p> </div> <div> <h4>Group 2 Content</h4> </div> <div> <h4>Group 3 Content</h4> </div> </div> <div class="edgePanel" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'"> Header content (top) </div> <div id="leftCol" class="edgePanel" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'left', splitter: true"> Sidebar content (left) </div> </div> </body> Dojo Configuration: var dojoConfig = { baseUrl: "${request.static_url('mega:static/js')}", //this is in a mako template tlmSiblingOfDojo: false, packages: [ { name: "dojo", location: "libs/dojo" }, { name: "dijit", location: "libs/dijit" }, { name: "dojox", location: "libs/dojox" }, ], parseOnLoad: true, has: { "dojo-firebug": true, "dojo-debug-messages": true }, async: true }; other js stuff: require(["dijit/layout/BorderContainer", "dijit/layout/TabContainer", "dijit/layout/ContentPane", "dojo/parser"]); css: html, body { height: 100%; margin: 0; overflow: hidden; padding: 0; } #appLayout { height: 100%; } #leftCol { width: 14em; }

    Read the article

  • manipulating textbox value

    - by chameios
    hello All, I am new to the programming world of dojo and web applications. I am trying to acomplish a task where I want to manipulate the textbox value with some text. I tried everything including some code from dojocampus, but even this code doesnot do anything. I have also tried to create an instance , with dojo.widget.byId and dijit.byId and then tried the instance.value = 'newtext' and everything that I could find but for some reason , the textbox is not updating. Please help me. <html> <head> <title>Dojo example</title> <style type="text/css"> @import "pathtodojo/dijit/themes/nihilo/nihilo.css"; </style> <style type="text/css"> </style> <script type="text/javascript" src="pathtodojo/dojo/dojo.js" djConfig="parseOnLoad:true, isDebug: true"></script> <script> dojo.require("dijit.form.TextBox"); function init() { var box0 = dijit.byId("value0Box"); var box1 = dijit.byId("value1Box"); box1.attr("value", box0.attr("value") + " modified"); dojo.connect(box0, "onChange", function(){ box1.attr("value", box0.attr("value") + " modified"); }); } dojo.addOnLoad(init); </script> <body class="nihilo"> A textbox with a value: <input id="value0Box" dojoType="dijit.form.TextBox" value="Some value" intermediateChanges="true"></input> <br> A textbox set with a value from the above textbox: <input id="value1Box" dojoType="dijit.form.TextBox"></input> <br> </body> </html> regards C

    Read the article

  • Dojo Widgets not rendering when returned in response to XhrPost

    - by lazynerd
    I am trying to capture the selected item in a Dijit Tree widget to render remaining part of the web page. Here is the code that captures the selected item and sends it to Django backend: <div dojoType="dijit.Tree" id="leftTree" store="leftTreeStore" childrenAttr="folders" query="{type:'folder'}" label="Explorer"> <script type="dojo/method" event="onClick" args="item"> alert("Execute of node " + termStore.getLabel(item)); var xhrArgs = { url: "/load-the-center-part-of-page", handleAs: "text", postData: dojo.toJson(leftTreeStore.getLabel(item), true), load: function(data) { dojo.byId("centerPane").innerHTML = data; //window.location = data; }, error: function(error) { dojo.byId("centerPane").innerHTML = "<p>Error in loading...</p>"; } } dojo.byId("centerPane").innerHTML = "<p>Loading...</p>"; var deferred = dojo.xhrPost(xhrArgs); </script> </div> The remaining part of the page contains HTML code with dojo widgets. This is the code sent back as 'response' to the select item event. Here is a snippet: <div dojoType="dijit.layout.TabContainer" id="tabs" jsId="tabs"> <div dojoType="dijit.layout.BorderContainer" title="Dashboard"> <div dojoType="dijit.layout.ContentPane" region="bottom"> first tab </div> </div> <div dojoType="dijit.layout.BorderContainer" title="Compare"> <div dojoType="dijit.layout.ContentPane" region="bottom"> Second Tab </div> </div> </div> It renders this html 'response' but without the dojo widgets. Is handleAs: "text" in XhrPost the culprit here?

    Read the article

  • Why can't I roll a loop in Javascript?

    - by Carl Manaster
    I am working on a web page that uses dojo and has a number (6 in my test case, but variable in general) of project widgets on it. I'm invoking dojo.addOnLoad(init), and in my init() function I have these lines: dojo.connect(dijit.byId("project" + 0).InputNode, "onChange", function() {makeMatch(0);}); dojo.connect(dijit.byId("project" + 1).InputNode, "onChange", function() {makeMatch(1);}); dojo.connect(dijit.byId("project" + 2).InputNode, "onChange", function() {makeMatch(2);}); dojo.connect(dijit.byId("project" + 3).InputNode, "onChange", function() {makeMatch(3);}); dojo.connect(dijit.byId("project" + 4).InputNode, "onChange", function() {makeMatch(4);}); dojo.connect(dijit.byId("project" + 5).InputNode, "onChange", function() {makeMatch(5);}); and change events for my project widgets properly invoke the makeMatch function. But if I replace them with a loop: for (var i = 0; i < 6; i++) dojo.connect(dijit.byId("project" + i).InputNode, "onChange", function() {makeMatch(i);}); same makeMatch() function, same init() invocation, same everything else - just rolling my calls up into a loop - the makeMatch function is never called; the objects are not wired. What's going on, and how do I fix it? I've tried using dojo.query, but its behavior is the same as the for loop case.

    Read the article

  • Password checking in dojo

    - by Richard
    I want to check that two passwords are the same using Dojo. Here is the HTML I have: <form id="form" action="." dojoType="dijit.form.Form" / <pPassword: <input type="password" name="password1" id="password1" dojoType="dijit.form.ValidationTextBox" required="true" invalidMessage="Please type a password" /</p <pConfirm: <input type="password" name="password2" id="password2" dojoType="dijit.form.ValidationTextBox" required="true" invalidMessage="This password doesn't match your first password" /</p <div dojoType="dijit.form.Button" onClick="onSave"Save</div </form Here is the JavaScript I have so far: var onSave = function() { if(dijit.byId('form').validate()) { alert('Good form'); } else { alert('Bad form'); } } Thanks for your help. I could do this in pure JavaScript, but I'm trying to find the Dojo way of doing it.

    Read the article

  • Programmatically controlling a Dojo Accordion

    - by prule
    I have a dijit.layout.AccordionContainer on my page which is defined in the html and created when dojo parses the page on load. Then, as the user interacts with the page I use Ajax to retrieve data and programmatically populate the container (removing existing items first). To illustrate my issue simply, here is some code that doesn't work: function doit() { var accordion = dijit.byId("accordionShell"); accordion.getChildren().each(function(item) { accordion.removeChild(item); }); for (i = 1; i < 5; i++) { var d = new dijit.layout.AccordionPane({title:'hello', content:'world'}); accordion.addChild(d); } } This fails, because only the first item in the accordian is visible. I think the others actually exist, but they are not visible so you can't do anything. I've managed to get around it by: Always ensuring there is 1 item in the accordian (so I never remove the first child) Call accordian.layout() after changing the contents So, this code "works" as long as you always want to see the first item, and don't actually expand any but the first one: function doit() { var accordion = dijit.byId("accordionShell"); var i = 0; accordion.getChildren().each(function(item) { if (i > 0) accordion.removeChild(item); i++; }); for (i = 1; i < 5; i++) { var d = new dijit.layout.AccordionPane({title:'hello', content:'world'}); accordion.addChild(d); } accordion.layout(); } I am using Dojo 1.2.0 - Anyone know what I am doing wrong?

    Read the article

  • Dojo - How to position tooltip close to text?

    - by user244394
    Like the title says i want to be able to display the tooltip close to the text, currently it is displayed far away in the cell. Tobe noted the tooltip positions correctly for large text, only fails for small text. In DOJO How can i position the tooltip close to the text? I have this bit of code snippet that display the tooltip in the grid cells. Screenshot attached, html <div class="some_app claro"></div> ... com.c.widget.EnhancedGrid = function ( aParent, options ) { var grid, options; this.theParentApp = aParent; dojo.require("dojox.grid.EnhancedGrid"); dojo.require("dojox.grid.enhanced.plugins.Menu"); dojo.require("dojox.grid.enhanced.plugins.Selector"); dojo.require("dojox.grid.enhanced.plugins.Pagination"); dojo.require("dojo.store.Memory"); dojo.require("dojo.data.ObjectStore"); dojo.require("dojo._base.xhr"); dojo.require("dojo.domReady!"); dojo.require("dojo.date.locale"); dojo.require("dojo._base.connect"); dojo.require("dojox.data.JsonRestStore"); dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dijit.Menu"); dojo.require("dijit.MenuItem"); dojo.require('dijit.MenuSeparator'); dojo.require('dijit.CheckedMenuItem'); dojo.require('dijit.Tooltip'); dojo.require('dojo/query'); dojo.require("dojox.data.QueryReadStore"); // main initialization function this.init = function( options ) { var me = this; // default options var defaultOptions = { widgetName: ' Enhancedgrid', render: true, // immediately render the grid draggable: true, // disables column dragging containerNode: false, // the Node to hold the Grid (optional) mashupUrl: false, // the URL of the mashup (required) rowsPerPage: 20, //Default number of items per page columns: false, // columns (required) width: "100%", // width of grid height: "100%", // height of grid rowClass: function (rowData) {}, onClick: function () {}, headerMenu: false, // adding a menu pop-up for the header. selectedRegionMenu: false, // adding a menu pop-up for the rows. menusObject: false, //object to start-up the menus using the plug-in. sortInfo: false, // The column default sort infiniteScrolling: false //If true, the enhanced grid will have an infinite scrolling. }; // merge user provided options me.options = jQuery.extend( {}, defaultOptions, options ); // check we have minimum required options if ( ! me.options.mashupUrl ){ throw ("You must supply a mashupUrl"); } if ( ! me.options.columns ){ throw ("You must supply columns"); } // make the column for formatting based on its data type. me.preProcessColumns(); // create the Contextual Menu me.createMenu(); // create the grid object and return me.createGrid(); }; // Loading the data to the grid. this.loadData = function () { var me = this; if (!me.options.infiniteScrolling) { var xhrArgs = { url: me.options.mashupUrl, handleAs: "json", load: function( data ){ var store = new dojo.data.ItemFileReadStore({ data : {items : eval( "data."+me.options.dataRoot)}}); store.fetch({ onComplete : function(items, request) { if (me.grid.selection !== null) { me.grid.selection.clear(); } me.grid.setStore(store); }, onError : function(error) { me.onError(error); } }); }, error: function (error) { me.onError(error); } }; dojo.xhrGet(xhrArgs); } else { dojo.declare('NotificationQueryReadStore', dojox.data.QueryReadStore, { // // hacked -- override to map to proper data structure // from mashup // _xhrFetchHandler : function(data, request, fetchHandler, errorHandler) { // // TODO: need to have error handling here when // data has "error" data structure // // // remap data object before process by super method // var dataRoot = eval ("data."+me.options.dataRoot); var dataTotal = eval ("data."+me.options.dataTotal); data = { numRows : dataTotal, items : dataRoot }; // call to super method to process mapped data and // set rowcount // for proper display this.inherited(arguments); } }); var queryStore = new NotificationQueryReadStore({ url : me.options.mashupUrl, urlPreventCache: true, requestMethod : "get", onError: function (error) { me.onError(error); } }); me.grid.setStore(queryStore); } }; this.preProcessColumns = function () { var me = this; var options = me.options; for (i=0;i<this.options.columns.length;i++) { if (this.options.columns[i].formatter==null) { switch (this.options.columns[i].datatype) { case "string": this.options.columns[i].formatter = me.formatString; break; case "date": this.options.columns[i].formatter = me.formatDate; var todayDate = new Date(); var gmtTime = c.util.Date.parseDate(todayDate.toString()).toString(); var gmtval = gmtTime.substring(gmtTime.indexOf('GMT'),(gmtTime.indexOf('(')-1)); this.options.columns[i].name = this.options.columns[i].name + " ("+gmtval+")"; } } if (this.options.columns[i].sortDefault) { me.options.sortInfo = i+1; } } }; // create GRID object using supplied options this.createGrid = function () { var me = this; var options = me.options; // create a new grid this.grid = new dojox.grid.EnhancedGrid ({ width: options.width, height: options.height, query: { id: "*" }, keepSelection: true, formatterScope: this, structure: options.columns, columnReordering: options.draggable, rowsPerPage: options.rowsPerPage, //sortInfo: options.sortInfo, plugins : { menus: options.menusObject, selector: {"row":"multi", "cell": "disabled" }, }, //Allow the user to decide if a column is sortable by setting sortable = true / false canSort: function(col) { if (options.columns[Math.abs(col)-1].sortable) return true; else return false; }, //Change the row colors depending on severity column. onStyleRow: function (row) { var grid = me.grid; var item = grid.getItem(row.index); if (item && options.rowClass(item)) { row.customClasses += " " +options.rowClass(item); if (grid.selection.selectedIndex == row.index) { row.customClasses += " dojoxGridRowSelected"; } grid.focus.styleRow(row); grid.edit.styleRow(row); } }, onCellMouseOver: function (e){ // var pos = dojo.position(this, true); // alert(pos); console.log( e.rowIndex +" cell node :"+ e.cellNode.innerHTML); // var pos = dojo.position(this, true); console.log( " pos :"+ e.pos); if (e.cellNode.innerHTML!="") { dijit.showTooltip(e.cellNode.innerHTML, e.cellNode); } }, onCellMouseOut: function (e){ dijit.hideTooltip(e.cellNode); }, onHeaderCellMouseOver: function (e){ if (e.cellNode.innerHTML!="") { dijit.showTooltip(e.cellNode.innerHTML, e.cellNode); } }, onHeaderCellMouseOut: function (e){ dijit.hideTooltip(e.cellNode); }, }); // ADDED CODE FOR TOOLTIP var gridTooltip = new Tooltip({ connectId: "grid1", selector: "td", position: ["above"], getContent: function(matchedNode){ var childNode = matchedNode.childNodes[0]; if(childNode.nodeType == 1 && childNode.className == "user") { this.position = ["after"]; this.open(childNode); return false; } if(matchedNode.className && matchedNode.className == "user") { this.position = ["after"]; } else { this.position = ["above"]; } return matchedNode.textContent; } }); ... //Construct the grid this.buildGrid = function(){ var datagrid = new com.emc.widget.EnhancedGrid(this,{ Url: "/dge/api/-resultFormat=json&id="+encodeURIComponent(idUrl), dataRoot: "Root.ATrail", height: '100%', columns: [ { name: 'Time', field: 'Time', width: '20%', datatype: 'date', sortable: true, searchable: true, hidden: false}, { name: 'Type', field: 'Type', width: '20%', datatype: 'string', sortable: true, searchable: true, hidden: false}, { name: 'User ID', field: 'UserID', width: '20%', datatype: 'string', sortable: true, searchable: true, hidden: false } ] }); this.grid = datagrid; };

    Read the article

  • Need help with DOJO

    - by Vani
    I am trying to integrate DOJO to my existing struts application. Listed below are the steps I followed. 1.Downloaded DOJO 1.4, copied dijit,dojo and dojox folders under my application folder jsp-jsDOJO copy paste "dialog via mark up example" (http://www.dojotoolkit.org/reference-guide/dijit/Dialog.html#dijit-dialog) When I run the application, I am getting javasript error dojo undefined. What I am missing?

    Read the article

  • dojo.connect won't connect 'onclick' with button

    - by Daniel
    I'm running into a problem using dojo.connect() to connect an 'onclick' event with this button: <button dojoType="dijit.form.Button" widgetId="inbox_button" id="inbox_button">Inbox</button> and the code making the connection is: var inbox_button=dojo.byId("inbox_button"); dojo.connect(inbox_button,'onclick',function(){ var container=dijit.byId("center"); container.addChild(new dijit.layout.ContentPane({region: "left", content: "...", style: "width: 100px;"})) }); However, instead of executing the function when the button is clicked, ANY onclick event triggers the function, and I end up with a lot of children containers. Even though I'm pretty certain the .connect() function should be available as part of dojo's base functionality, I've 'required' it explicitly: dojo.require("dojo._base.connect"); Any ideas as to why this might be happening?

    Read the article

  • display data from json file in datagrid

    - by kayn
    I want to display data from a json files in a data grid using dojo ver 1.0.0. I am able to diplay the data when i declare it on my code but when i store the same data in a json format so i can reference it in my script,i get an empty grid. This is my json file; { data: [ ['10''myfile','Css', 'CS Degree','Dr. Bottoman','This is mine'], ['10'myfile2','CS716', 'CS Degree','Prof Frank', 'This is course'], ['10'myfile3 ','CS714', 'CS Degree', 'Dr. Ree', 'Welcome'], ['14', 'myfile4','CS772', 'CS Degree', 'Mr. Boss', 'This will display content' ], ['18', 'myfile5','CS774', 'CS Degree','Ms. Kirk', 'This is networks.' ] ] } and below is my code; @import "../../../dojo/resources/dojo.css"; @import "../_grid/Grid.css"; body { font-size: 1.0em; } #grid { height: 400px; border: 1px solid silver; } .text-oneline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .text-scrolling { height: 4em; overflow: auto; } .text-scrolling { width: 21.5em; } dojo.require("dojox.grid.Grid"); dojo.require("dojox.grid._data.model"); dojo.require("dojo.parser"); <script type="text/javascript"> /*<span dojoType="dojo.data.ItemFileWriteStore" jsId="myStore" url="course.json"> </span>*/ data = [ ['10''myfile','Css', 'CS Degree','Dr. Bottoman','This is mine'], ['10'myfile2','CS716', 'CS Degree','Prof Frank', 'This is course'], ['10'myfile3 ','CS714', 'CS Degree', 'Dr. Ree', 'Welcome'], ['14', 'myfile4','CS772', 'CS Degree', 'Mr. Boss', 'This will display content' ], ['18', 'myfile5','CS774', 'CS Degree','Ms. Kirk', 'This is networks.' ] ]; getDetailData = function(inRowIndex) { var row = data[this.grid.dataRow % data.length ]; switch (this.index) { case 0: return row[5]; case 1: return row[2]; case 2: return row[0]; case 3: return row[1]; case 4: return row[3]; case 5: return row[4]; default: return row[this.index]; } } getName = function(inRowIndex) { var row = data[inRowIndex % data.length]; return row[1]; } // Main grid structure var gridCells = [ { type: 'dojox.GridRowView', width: '20px' }, { onBeforeRow: function(inDataIndex, inSubRows) { inSubRows[1].hidden = !detailRows[inDataIndex]; }, cells: [[ { name: 'Master', width: 3, get: getCheck, styles: 'text-align: center;' }, { name: 'Detail', get: getName, width: 60 }, ], [ { name: '', get: getDetail, colSpan: 2, styles: 'padding: 0; margin: 0;'} ]] } ]; // html for the +/- cell function getCheck(inRowIndex) { var image = (detailRows[inRowIndex] ? 'open.gif' : 'closed.gif'); var show = (detailRows[inRowIndex] ? 'false' : 'true') return ''; } // provide html for the Detail cell in the master grid function getDetail(inRowIndex) { var cell = this; // we can affect styles and content here, but we have to wait to access actual nodes setTimeout(function() { buildDetailgrid(inRowIndex, cell); }, 1); // look for a Detailgrid var Detailgrid = dijit.byId(makeDetailgridId(inRowIndex)); var h = (Detailgrid ? Detailgrid.cacheHeight : "120") + "px"; // insert a placeholder return ''; } // the Detail cell contains a Detailgrid which we set up below var DetailgridCells = [{ noscroll: true, cells: [ [ {name: "Brief Course Description",width: "auto"}, {name: "Course Code" }, {name: "Credits" }, {name: "Subject" }, {name: "Prerequisite" }, {name: "Lecturer"}], [] ]}]; var DetailgridProps = { structure: DetailgridCells, rowCount: 1, autoHeight: true, autoRender: false, "get": getDetailData }; // identify Detailgrids by their row indices function makeDetailgridId(inRowIndex) { return grid.widgetId + "Detailgrid"/+ inRowIndex/; } // if a Detailgrid exists at inRowIndex, detach it from the DOM function detachDetailgrid(inRowIndex) { var Detailgrid = dijit.byId(makeDetailgridId(inRowIndex)); if (Detailgrid) dojox.grid.removeNode(Detailgrid.domNode); } // render a Detailgrid into inCell at inRowIndex function buildDetailgrid(inRowIndex, inCell) { var n = inCell.getNode(inRowIndex).firstChild; var id = makeDetailgridId(inRowIndex); var Detailgrid = dijit.byId(id); if (Detailgrid) { n.appendChild(Detailgrid.domNode); } else { DetailgridProps.dataRow = inRowIndex; DetailgridProps.widgetId = id; Detailgrid = new dojox.VirtualGrid(DetailgridProps, n); } if (Detailgrid) { Detailgrid.render(); Detailgrid.cacheHeight = Detailgrid.domNode.offsetHeight; inCell.grid.rowHeightChanged(inRowIndex); } } // destroy Detailgrid at inRowIndex function destroyDetailgrid(inRowIndex) { var Detailgrid = dijit.byId(makeDetailgridId(inRowIndex)); if (Detailgrid) Detailgrid.destroy(); } // when user clicks the +/- detailRows = []; function toggleDetail(inIndex, inShow) { if (!inShow) detachDetailgrid(inIndex); detailRows[inIndex] = inShow; grid.updateRow(inIndex); } dojo.addOnLoad(function() { window["grid"] = dijit.byId("grid"); dojo.connect(grid, 'rowRemoved', destroyDetailgrid); }); Test grid

    Read the article

  • How to control Dojo FilteringSelect default rendering!?

    - by Nick
    Hi, I have a dojo dijit.filering.select that populates with values from a dojo.data.ItemFileReadStore. Everything is working fine except I would like the filtering select to automatically get populated with the first value in the itemFileReadStore. Currently it is loading them as a list of options that are revealed when you click the down arrow, as per spec. I would instead like filteringSelect to be loaded with the first value. How do I do this? For some reason I cant figure it out. Any help would be hugely appreciated! Kind Regards Nick Frandsen <script type="text/javascript"> function updateOptions(){ var itemId = dijit.byId("item_select").attr("value"); var jsonStore = new dojo.data.ItemFileReadStore({ url: "/options/get-options-json/itemId/" + itemId }); optionSelect.attr("store", jsonStore); } </script> <select dojoType="dijit.form.FilteringSelect" name="option_select" id="option_select" labelAttr="name" required="true" jsId="optionSelect"> </select>

    Read the article

  • JavaScript/Dojo Module Pattern - how to debug?

    - by djna
    I'm working with Dojo and using the "Module Pattern" as described in Mastering Dojo. So far as I can see this pattern is a general, and widely used, JavaScript pattern. My question is: How do we debug our modules? So far I've not been able to persuade Firebug to show me the source of my module. Firebug seems to show only the dojo eval statement used to execute the factory method. Hence I'm not able to step through my module source. I've tried putting "debugger" statements in my module code, and Firebug seems to halt correctly, but does not show the source. Contrived example code below. This is just an example of sufficient complexity to make the need for debugging plausible, it's not intended to be useful code. The page <!-- Experiments with Debugging --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>console me</title> <style type="text/css"> @import "../dojoroot/dojo/resources/dojo.css"; @import "../dojoroot/dijit/themes/tundra/tundra.css"; @import "edf.css"; </style> <script type="text/javascript" src="../dojoroot/dojo/dojo.js"> </script> <script type="text/javascript" > dojo.registerModulePath("mytest", "../../mytest"); dojo.require("mytest.example"); dojo.addOnLoad(function(){ mytest.example.greet(); }); </script> </head> <body class="tundra"> <div id="bulletin"> <p>Just Testing</p> </div> </body> </html> <!-- END: snip1 --> The java script I'd like to debug dojo.provide("mytest.example"); dojo.require("dijit.layout.ContentPane"); /** * define module */ (function(){ //define the main program functions... var example= mytest.example; example.greet= function(args) { var bulletin = dojo.byId("bulletin"); console.log("bulletin:" + bulletin); if ( bulletin) { var content = new dijit.layout.ContentPane({ id: "dummy", region: "center" }); content.setContent('Greetings!'); dojo._destroyElement(bulletin); dojo.place(content.domNode, dojo.body(), "first"); console.log("greeting done"); } else { console.error("no bulletin board"); } } })();

    Read the article

  • dojo parser not escaping quotation marks in attributes?

    - by peirix
    Whenever I'm using quotation marks inside an attribute value in dojo, it seems dojo's parser isn't handling it very well... <textarea name="content.locale['en']" dojoType="dijit.form.SimpleTextarea"> </textarea> Turns into: <textarea ]="" en="" name="content.locale["></textarea> With the surrounding <div>s and what not is added by the dijit widget. Any ideas? EDIT Seems this is working as it should with other elements, it's just the SimpleTextarea that's causing a problem..

    Read the article

  • how to stop onChange in javascript

    - by shrimpy
    in one of my selection box, i have a onChange="..." specified... coz i want to change some other form value after any selection changes. however ... in the same page, some wired case i have to manually set the value.. so i have to use some javascript to set the value of the selection combox, but in this case, i don`t want that onChange event to be fired... how can i walk around it??? Forgot to mention that i am actually using dijit.form.comboBox. for normal HTML form comboBox, it won`t cause any issue. Only i use the dijit comboBox, and i try to set the value to some other value, dojo will trigger the onChange.

    Read the article

  • What UI Library(widgets) are you using in your Spring MVC or Spring Web Flow Project [closed]

    - by techsjs2012
    What UI Library(widgets) are you using in your Spring MVC or Spring Web Flow Project I am working on a number of projects with Spring MVC and Spring Web Flow and we started to use Dojo(dijit) widgets for the UI Library. I would like to hear from other projects if anyone knows of anything better or what are you using?? My screens looks like the one below.. the layouts are easy but I need hightlighting, tooltips and more...

    Read the article

< Previous Page | 1 2 3 4  | Next Page >