dojo

How can I filter a dstore using the contains method?

£可爱£侵袭症+ 提交于 2019-12-06 08:51:46
I have a dgrid populated with a dstore plain old Memory collection, that I am trying to filter using the 'contains' filter method. The store data looks something like this: [ {id:"25", users: ["13", "15"]}, {id:"347", users: ["13"]}, {id:"653", "users":["13", "17"]} ] I want to retrieve all the records where a given user is in the users array. From my understanding, I was expecting to be able to set up a filter like new Filter().contains('users', '15'); and set that as the collection for the grid, leaving one row (id = '25') in this example. However, I am left with 0 rows. I have also tried

How to determine if a dojo grid has finished loading?

我们两清 提交于 2019-12-06 08:49:37
I'm working with Selenium to drive a site that uses Dojo. Since the site's Dojo grid uses lazy loading, it's difficult for my test framework to know if/when the grid has finished loading. However, Selenium does let you inject Javascript. Is there a way to either poll the DOM, or use js directly, to find out if a grid has finished loading? Here is a great answer that I found: grid.connect(grid, '_onFetchComplete', function(){ for(var i in grid._pending_requests){ if(grid._pending_requests[i]){ return; //no, something's not loaded yet. } } //okay, nothing is on the fly now. }); http://dojo.6188

dojo parser and a TypeError using ArcGIS JS API

半城伤御伤魂 提交于 2019-12-06 07:58:32
问题 I'm getting this error: TypeError: 'undefined' is not a function (evaluating 'parser.parse()') Here's my code. <script> require([ "esri/map", "esri/layers/FeatureLayer", "esri/dijit/Legend", "esri/digit/HomeButton", "dojo/_base/array", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer", "dojo/domReady!" ], function( Map, FeatureLayer, Legend, arrayUtils, parser, HomeButton ) { parser.parse(); var map = new Map("map", { basemap:

Simple Login implementation for Dojo MVC

a 夏天 提交于 2019-12-06 07:44:55
问题 Is there any example on how to implement a simple login page/dialog? I have been trying to do it with dojo boilerplate (check my previous questions : Layout implementation for Dojo MVC). So far, I have been able to display my dialog box. But I want to be able to get my data and on click event want to have an alert box for example (with his content). My view: <form action="Login" method="post" validate="true" id="loginForm"> <table width="258">   <tr> <td><label>Login</label></td> <td><input

How to Focus inthe First Cell of a Newly-Added Row in a dojox.grid.DataGrid

戏子无情 提交于 2019-12-06 07:17:09
问题 I am adding a new blank row to a dojox.grid.DataGrid, and want to focus in the first cell of the new row. I add the row by calling: var new_row = {}, attributes = store.getAttributes( items[0] ); dojo.forEach( attributes, function( attribute ) { dojo.forEach( attributes, function( attribute ) { new_row[ attribute ] = null; } ); } ); store.newItem( new_row ); I believe the following code will do the focusing: grid.focus.setFocusIndex( row_index, 0 ); grid.edit.setEditCell( grid.focus.cell, row

Value of dojox.CheckedMultiSelect not being posted with dojo.xhrPost

∥☆過路亽.° 提交于 2019-12-06 07:14:01
When I post a form using dojo.xhrPost , I get all the fields in my form POSTed except for the value of my dojox.CheckedMultiSelect, no matter what options are selected. The declaration of my CheckedMultiSelect: <div dojoType="dojo.data.ItemFileReadStore" jsId="processTypeList" url="json/processtypelist.json.php"></div> <label for="processTypeSelect">Process Types</label> <select dojoType="dojox.form.CheckedMultiSelect" name="processTypeSelect" id="processTypeSelect" multiple="true" style="height:166px;" store="processTypeList"></select> And here is my xhrPost: <button dojoType="dojox.form

Is it possible to have Dojo/Dijit DataGrid autoheight functionality based on the parent div size instead of a number of rows?

青春壹個敷衍的年華 提交于 2019-12-06 06:55:27
问题 I have a datagrid that is updated periodically and the number of rows inside it grows steadily over time. It is inside of a parent div with a height of 60% of the screen. If I set autoheight to, say, 5 rows, the table works properly. When a sixth row is added, a scrollbar appears within the datagrid and I can scroll up/down and the headers remain fixed at the top and visible. Unfortunately, once I have a lot of data, this is a waste of space -- I have 60% of the screen's height to work with,

Getting global handler to all AJAX calls in dojo

寵の児 提交于 2019-12-06 06:52:55
I need to invoke some common methods before an AJAX call is made and after the AJAX call (before the actual handler method is called) is success. I'm using dojo.aspect to achieve this. This is my code sample function makeAjaxCall(){ dojo.xhrGet({ url:"sample_url", content:{ test:"value" }, load:function(response){ //Do some logic here }, error:function(response){ //handle error } }); } Below is the dojo.aspect which I'm using to get a hook to the XHR calls. define(["dojo/aspect"], function(aspect){ aspect.after(dojo, "xhr", function(deferred){ console.log("AJAX AFTER"); deferred.then(function

Sub-widgets won't render (will have 0 height) in Dojo

橙三吉。 提交于 2019-12-06 06:40:34
Have a look at this simple fiddle: http://jsfiddle.net/mercmobily/y4uG2/10/ Basically I declare a Widget, and start adding away sub-widgets. At one point, I have the sub-widget "section" which is a templated widget with a tab container and sub-tabs. The main widget has: '<div data-dojo-type="Section" data-dojo-props="title: \'Sub Widget\'" data-dojo-attach-point="section"></div>' + And that "section" widget has: templateString: '' + ' <div>' + ' <div class="subWidget" data-dojo-type="dijit.layout.TabContainer" tabPosition: \'left-h\'" dojo-attach-point="tabCont" >' + ' <div data-dojo-type=

escaping json string with a forward slash?

百般思念 提交于 2019-12-06 06:24:20
问题 I am having a problem passing a json string back to a php script to process. I have a json string that's been created by using dojo.toJson() that contains a / and looks like this: [{"id":"2","company":"My Company / Corporation","jobrole":"Consultant","jobtitle":"System Integration Engineer"}] When I pass the string back to the php script it get's chopped at the / and creates a malformed json string, which then means I can't convert it into a php array. What is the best way of escaping the /