问题标签 [jqpivot]
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.
jquery - 如何在数据透视单元格中放置不同类型的值?
我有以下json
数据我试图创建以下pivot jqgrid
JSON
JQGRID 图像
正如您在json
数组中看到的,属性名称cellvalue
已分配给枢轴单元格。但问题是,它仅在cellvalue
属性值为数字字符串时显示单元格值,但如果属性为文本字符串,则不会在枢轴单元格中显示单元格值。cellvalue
我该如何解决?
PS:我用的是free-grid(新版的free jqgrid)
我有更多与此相关的问题,但主要我需要上述答案。
谢谢
jqgrid - 如何对数据透视中的列进行分组?
我编写了以下代码来创建一个pivot grid
显示有关汽车的销售信息。它应该生成一个类似于图像上的网格的网格结构
完整的代码可以在这个Fiddle 代码中找到。但是,当我应用代码以使用以下代码行对列标题进行分组时:
它没有按预期对列进行分组。为什么会这样,我该如何解决?
祝大家新年快乐!
jquery - How to hide/show columns on a pivot grid?
The following code generates a pivot grid with two buttons on the tool bar
Here is jsfiddle with the complete code.
The Grid toolbar has two buttons, Hide and show. When the user clicks hide, it should hide the date columns '2011-04-23','2010-12-15' and when user clicks show, it should show the dates columns '2011-04-23','2010-12-15' .
i have used following code to achieve hide and show
on the click event of the hide button
on the click event of the show button
but the code lines jQuery("#list483").jqGrid('hideCol',datestoHide);
and jQuery("#list483").jqGrid('showCol',datestoShow);
does not seems to work. why is that and how do i hide/show the columns?
jquery - 如何停止 Jqpivot 的自动排序?
下面的 jqpivot 网格显示汽车租赁的销售信息。完整的代码在jsfiddle
根据这个wiki ,在wiki底部的jqpivot官方wiki上禁止自动排序,它指出:
按整个 x 或 y 向量自定义排序
选项 compareVectorsByX 和 compareVectorsByY 允许指定回调函数,该函数将用于按整个 x 或 y 向量进行自定义排序。
按向量排序的默认实现可以在这里找到。它是 ArrayOfFieldsets 的 compareVectorsEx 方法。重要的是要了解该函数将用于两个目的:1)比较向量 2)找到比较向量存在差异的向量索引。因此方法 compareVectorsEx 返回具有两个属性的对象:索引和结果。属性结果是众所周知的值 -1,表示第一个向量小于第二个向量,0 表示向量等于,1 表示第一个向量大于第二个向量。属性索引返回向量不同的比较向量元素的从 0 开始的索引。
我已经compareVectorsEx
按照说明添加了功能,但是如何使用该功能来停止自动排序?
我必须停止所有 x 字段的自动排序。我需要停止排序的原因是让网格以与原始 json 相同的顺序显示字段制作和模型。
更新:
我已将原始json
数据源修改为在每个对象上有两个属性,groupheaderorder
并且childorder
. 属性groupheaderorder
是make
对象的属性顺序,json
属性是所有品牌名称的属性顺序。childorder
model
这是json数据
这是 jsfiddle 代码的链接(除了添加了新的两个属性之外,这与我的原始帖子的代码相同)
让我通过一个例子来解释一下
josn里有三辆丰田和两辆日产。如果您查看相同品牌和型号groupheaderorder
的数字和childorder
编号,它们具有相同的值,但对于不同的品牌和型号,它们具有不同的值。因此,对于品牌和型号的不同组合,和的组合始终是唯一的。我认为这可能是为grouptext及其子项提供自定义排序顺序的好选择,因为它们保留并显示其原始排序顺序。groupheaderorder
childheaderorder
原始数据来自我无法在存储过程代码中修改的存储过程,而且令人生畏的返回结果集甚至没有用于排序的列。因此,在我从 ASP MVC 构建的 Web 应用程序中,在其控制器逻辑中,我唯一的选择是添加这两个排序属性,以便将它们包含在json.
可能还有其他更好的方法,如果是这样,我真的很想知道:)
但是,由于我添加了这两个属性以保留原始排序顺序,是否可以在生成的枢轴网格中保留并显示此顺序?
jqgrid - How to sort column data in alpha-numeric order in pivot?
the following link generates a pivot jqgrid that will load some sales information about cars enter link description here
it has about 11 car sales objects. it has a custom sort order that i have given and the purpose of the custom sort order to display data in custom order when data loads to the grid and it works but the issue is when user clicks the column name 'model' it should be sorting car names by name in the alphabetical order but instead its sorts using my custom order. But it should not use custom order to sort columns when user clicks on the header, it should use its default sort order sorting by alphabetical order.
How do i still keep the custom order that i have given and at the same time let the columns gets sorted in the alphabetical order if user clicks a column?
secondly, Different browser shows different ways. when i load the grid with a large dataset it behaves differently in two of the following operations
In chrome: 1. When user selects 'All' (show all records) from the navbar at the bottom the custom order that i have given as the sort order for grid load breaks and some gets positioned in different places
but in IE browser, this won't happen
- In both IE and chrome, after loading data when user clicks the column name
Model
column data gets sorted using custom sort order and not by alphabetical order.
How do i fix these issues
jqgrid - 如何解决行的对齐问题?
在小提琴小提琴代码上,jqpivot 显示汽车的销售数据。以下问题可能是 CSS 问题或配置问题。当我在 IE 中运行相同的代码时,网格高度的大小设置为 100。
如下图所示,当用户向下滚动并停在某个点并单击行时,荧光笔显示该行不在一行中,而是出现了视觉分割。. 对于大型数据集,这在 IE 上是肉眼可见的。我该如何解决这个问题?
jqgrid - 分页/导出的平均计算错误
我在将聚合器与 avg 一起使用时遇到了麻烦,因为每次分页返回或发生导出时,它都会将最后一个结果除以数量。
因此,第一次在页面/导出上的平均值是正确的,并且每次后续导出/返回最后一个结果都会再次除以行数。
这只发生在不止一个 xDimension 上。
同样在每次导出的导出中,每个摘要标题都会重复 X 次导出。
有人经历过吗?jqgrid 5.3.0。
编辑:(图像已删除,示例已删除)