问题标签 [dojox.grid]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1117 浏览

dojo - Dojo 数据网格不会显示在另一个 div 中

我正在尝试让 Dojo 数据网格正常工作 - 我已经在文档页面 ( http://docs.dojocampus.org/dojox/grid/DataGrid ) 上复制了第一个示例并且它工作得很好。

但是,当我尝试在另一个 div 中显示网格(即,将示例中的“gridContainer4”放在任何其他 div 中)时,什么也没有显示...

任何帮助将不胜感激 - 在网上任何地方都找不到任何关于此的信息!

0 投票
2 回答
13001 浏览

dojo - dojox.enhancedGrid 获取选定行

如何获取 dojox.enhancedGrid 的选定行对象?我正在使用 selectionMode: 'single' 例如单选按钮。

dijit.byId("gridViewWidget").selection.selectedIndex 返回行索引。但是如何获取该 Index 的 rowObject 呢?我可以获得rowNode()但我需要的是该行的 id 列的值。

它可以遍历返回的 HTML DOMrowNode()但是有没有直接的方法?

我目前正在使用dijit.byId("gridViewWidget").store._dataArray[i]并传递返回的索引。尽管这可行,但似乎 _dataArray 是私有财产。那么使用安全吗?

0 投票
1 回答
828 浏览

dojo - Dojo Datagrid 抛出“单元格未定义”

启动后会抛出错误“cell is undefined”(943 out of range 516)

0 投票
3 回答
9811 浏览

dojo - Dojo:如何在网格的上下文菜单项处理程序中获取行数据?

我正在使用 Dojo 1.4。

给定标记中的 dojox.grid.DataGrid:

我还没有找到一种更好的方法来显示网格的上下文菜单:

它可以工作,弹出菜单并调用函数“gridRowContextMenu_onClick”。

我的问题是如何在 menuitem 的 onClick 处理程序 (gridRowContextMenu_onClick) 中获取弹出菜单的原始行?

0 投票
4 回答
6759 浏览

ruby-on-rails - Dojox Grid 将两个字段传递给格式化程序

我成功创建了一个 dojox.Grid,但在一种情况下,我需要将两个字段传递给格式化程序函数,而不仅仅是一个。例如:

例如,我需要将“id”和“name”都传递给 formatterFunction()。我怎样才能做到这一点?谢谢你。

0 投票
1 回答
1216 浏览

datagrid - Dojo datagrid and treegrid help - datagrid has a reformating flash?

I'm having a bit of a time trying to get Dojo grids (1.5) to play nice. Specifically I've spent about two weeks of work trying to implement a grid that allows for our result set data to collapse into rows, where rows can be expanded. Data comes in as a full set in JSON format, using ItemFileReadStore as the store. Any subsequent sorts or pagings are handled by GETing a new json from the application, and passing in new query parameters in the url.

The nested data was only two layers deep - a top layer to always be displayed and an array of child data with identical structure as the top layer. Each node has a unique ID and a cluster ID - on a parent node the unique ID and cluster ID will match.

I was initially very excited with TreeGrid - but I couldn't see how I could format it to do what I needed - namely eliminate the 'summary row' and one extra row full of null cells (???) that I just couldnt figure out how to remove unless I focused the query to only one cluster. I studied the test examples, built many test pages myself, tried to understand the forestModel, which for what I could tell was unnecessary... I found so little documentation, and sources I found online hinted that TreeGrid might not be reliable...

So I decided I would try to implement the expandable/collapsible rows in dataGrid.

I flattened the JSON data and added another attribute to indicate being a top level node ('alwaysShow' = true). I built my grid programaticaly and applied grid.filter() to pull only those top level nodes. I modified that filter by extending the ItemFileReadStore _FetchItems "filter" method to allow for OR querying instead of AND, and also modified it to allow for keys to point to arrays - when a top level node (small +/- icon in the cell) is clicked, the cluster ID of the parent node is added to the grid.filter.allowed[] and the filter is updated, allowing nodes with that cluster_id value to be displayed.

This worked fine on my small test set of five records (although id say a little slugish...) - but now I am pulling ~900 rows back from the application, and on expanding large clusters (~80 rows) I am seeing a very long flash of blue and white on the filter updates. I've spent most of my day trying to step through in firebug to find where its happening, but the dojo logic is so spread out. Seems to be happening before the call to _Grid.js defaultUpdate.

Its so bad that I am considering trying again with TreeGrid. Im also considering just doing this by hand... Im kicking myself for spending so much time trying to get Dojo to work to begin with. I would also consider a commercial "JSON->table with collapsible row" library if anyone has any recommendations...

Any suggestions or insights? Familiarity with the flashing problem or how I could adapt TreeGrid to my needs? I'm aware this is a bit of a rant... Many thanks for any help.
-robbie

EDIT: I eventually gave up trying to get Dojo to do what I needed and coded it myself in less than a day. Not the best use of three weeks...

0 投票
0 回答
1058 浏览

dojox.grid - 按日期筛选道场网格

这是我的问题:

我有一个显示记录列表以及记录日期的网格。考虑到这一点,我创建了一个过滤器表单,允许用户根据日期过滤数据。这里的问题是如何过滤日期。这是我到目前为止所拥有的:

MyGrid 是从我的数据存储中填充的:

url: "xhreq?action=getRecords",
clearOnClose: true,
urlPreventCache: true });

在我的表格布局中,我使用 dateTextBox 为用户添加要过滤的日期:

{ 名称:“日期”,字段:“日期”,宽度:“10em”,
类型:dojox.grid.cells.DateTextBox,格式化程序:formatDateObject,约束:{ datePattern:'MM/dd/yyyy',formatLength:'short ',选择器:'日期'},可编辑:真},

这就是我开始对我的日期进行过滤的方式:从网格中过滤数据:

doFilter: function() { filter_standby.show();

inDate = "*";

if(filter_inDateFrom.attr("value") != "" || filter_inDateThrough.attr("value") != ""){ { totalDays = inDateThru - inDateFrom; 存储 totalDays 日期 = 日期 + totalDays;// 根据总天数过滤 }

现在有没有办法返回一个范围内的日期?如果不是,处理日期的最佳方法是什么?

谢谢

0 投票
3 回答
4727 浏览

dojo - dojox.grid.DataGrid 自定义排序方法?

我有一个 dojox.grid.DataGrid,其中一列中有日期数据。例如

当我单击标题并对列进行排序时,我得到了这个......

它已对字符串值进行排序,而不是将其排序为日期值,因此第 19 个被放错了位置。

我想要一个自定义排序器方法,或者以某种方式告诉网格它呈现的数据类型。

另一种方法是找到某种方式将日期编码为 JSON 字符串,并为表格列提供自定义格式化程序?

任何人都可以帮忙吗?

谢谢杰夫波特

0 投票
1 回答
1747 浏览

dojo - Dojo:从 DojoX 网格中获取显示的项目

有没有办法从 dojox.grid 中获取所有显示的项目?

我们有一个带有查询的过滤器,现在我们需要当前显示的所有项目。要获得所有选定的项目是没有问题的:

0 投票
1 回答
742 浏览

dojox.grid - 如何在拖放(DnD)操作后获得增强网格列的新顺序

我们正在寻找一种在同一网格内进行一些列拖放操作后记录增强网格中列顺序的方法,因为网格的布局在 DnD 操作后不会改变,我找不到任何获取列序列的方法。有什么直接的方法吗?或者,我们是否有任何与 DnD 相关的事件,可以用来跟踪网格中的列序列。