Login Register

Grid

How do I tell the grid to reload the data if the db has changed?

I've got a grid, with a dojo.data.ItemFileWriteStore, which is coming from a db via php. Another process is making changes to the database and I want to refresh the content of the grid without reloading the whole page. It sure seems like grid._refresh() or grid.update() or grid.store.SOMETHING() should do it, but I can't make it work.

Any hints?

How can I pass an already loaded store to dataGrid without reloading store?

Hi,

I am using a dataGrid with a JsonRestStore, and the grid Layout is created dynamically based on the data from the store as the number of fields may vary.
In order to do this, I do a store.fetchItemByIdentity( etc etc) and pass the fetched Item to my createDynamicLayout(item) function, which analyses the item to determine how many fields it has.
Then I execute the dataGrid definition with the dynamically created Layout. So far so good.

However, the store is loaded twice. Once when I first fetch an item to analyse the data and once upon declaration of the grid.

Grid as Widget - Display problem

Hi,

i have a strange Problem, iam trying to add an Grid as own widget : iam using the following code

dojo.provide("myWidgets.ShopShow");

dojo.require("dijit._Widget");
dojo.require("dijit._Templated");

dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dojox.grid.DataGrid");
dojo.require("dijit.layout.ContentPane")
dojo.require("dijit.layout.LayoutContainer");

dojo.declare(
"myWidgets.ShopShow",
[dijit._Widget, dijit._Templated],
{
widgetsInTemplate: true,
templatePath: dojo.moduleUrl("myWidgets", "templates/shopshow.html"),

Grid _refresh() without "Loading..."

Has anyone found a best practice/method for updating/refreshing a grid without getting the "Loading..." screen? I'm currently polling a cgi script that outputs changing JSON data every 2seconds (I eventually want to migrate to a comet type solution). What I'm trying to get is the look and feel as when I delete a row with: store.deleteItem(selectedItem); where the row is immediately deleted. Is there a practice to get the grid to update instantly, much like on an item deletion?

select all button

I'm trying to implement a select all button (using a checkbox) for a grid, and I'm running into what I think is a bug. Here's my code:

function selectAll(chkbox) {
        var grid = dijit.byId('gridNode');
        if (chkbox.checked) {
                // select all
                grid.selection.selectRange(0, grid.rowCount-1);
        } else {
                grid.selection.deselectAll()
        }
}

Problem is, it only actually selects the number it has in memory at the moment. And in fact, it throws errors on the non-loaded items if you have an onSelected handler.

Display and xml data fetching problems

Hi everybody,
I am coming here in hope for an answer to a situation I am having at with a Grid widget. I would like to use this widget to display xml data in an iframe. The iframe would contain the grid and a few buttons below the grid for UI actions.

I ran into three problems:
- first problem, solved: the xml file has a very weird way of referencing fields. Instead of :
* either <row><field1>value-of-field1</field1> (no attribute map needed)
* or <row field1="value-of-field1" field2="...></row> (attribute map with syntax "row.field1":"@field1")

Change Row Color Programmatically

I create a grid programmatically, fine so far.
I use "eval" as in "que" I store a certain query string.
Everything works perfect.

With the function cell_style_UVorname I also can modify the style for an individual cell
depending on a condition. Also fine.

With the function colorDescriptions I can modify the whole row,
but I couldnt build in a condition, such as "if certainField="something" color=green".
There are some declarative examples, but I couldnt get them working programmatically.

Here is the code:

how to create an info footer?

I've got a grid, and I want to put an info box below it, showing the number of rows, the number selected, and (if possible) the range of visible items. Something like:

Showing Rows 1-10 of 200 (15 Selected)

For the total rows, I found the grid.rowCount property, but how do I update my display once the grid has been fully loaded. dojox.VirtualGrid.postrender seems promising, but I don't understand how to implement that.

For the number selected, dojox.grid.publicEvents.onSelectionChanged looks promising.

For the range, I have no idea....

Any help out there?

drag and drop auto arranging grid?

Hi,

I'm new to the UI side of AJAX, and I found the Dojo framework and it looks pretty promising! So I hope there is something in Dojo which has the functionality like this: http://tool-man.org/examples/sorting.html (scroll down to the section "Example: Sorting in two dimensions"). Thanks for your pointers!

Suan

sortField property in html for dojoGrid?

i'd like to do something like

<th field="budget" sortField="budgetValue" width="20%">Budget</th>
<th field="expenditures" sortField="expendituresValue" width="20%">Expenditures</th>
Syndicate content