Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Dojo数据网格中为FilteringSelect小部件设置默认值?_Select_Datagrid_Dojo_Filtering - Fatal编程技术网

如何在Dojo数据网格中为FilteringSelect小部件设置默认值?

如何在Dojo数据网格中为FilteringSelect小部件设置默认值?,select,datagrid,dojo,filtering,Select,Datagrid,Dojo,Filtering,我正试图在DOJO数据网格中的filteringSelect小部件中将为存储读取的动态值显示为选项。这些值正在按预期填充,但是,当网格加载时,我无法显示默认值,现在它显示为“…”,单击一次,我可以看到一个下拉列表 下面是示例代码的位置: 我想在上面的代码中遍历我的“myStore”,并将带有label='Y'的项作为该filteringSelect的默认项 我希望在渲染栅格或过滤选择后立即显示默认值。任何指针或示例代码都会有很大帮助。很高兴我也能修复它。下面是代码,以防有人想要实现类似的功能

我正试图在DOJO数据网格中的
filteringSelect
小部件中将为存储读取的动态值显示为选项。这些值正在按预期填充,但是,当网格加载时,我无法显示默认值,现在它显示为“…”,单击一次,我可以看到一个下拉列表

下面是示例代码的位置:

我想在上面的代码中遍历我的“myStore”,并将带有
label='Y'
的项作为该
filteringSelect
的默认项


我希望在渲染栅格或过滤选择后立即显示默认值。任何指针或示例代码都会有很大帮助。

很高兴我也能修复它。下面是代码,以防有人想要实现类似的功能

基本上,我所要做的就是在我创建的第一个json中为该字段/单元格发送一个默认值

jsonStore = new dojo.data.ItemFileWriteStore({
        data: {
            "identifier": "identify",
            "label": "description",
            "items": [
                {
                "identify": 123,
                "description": "Project Manager",
                "billingMethod":"Sample"},
            {
                "identify": 234,
                "description": "Developer"},
            {
                "identify": 536,
                "description": "Developer"}
            ]
        }
    });    
请注意,我所要做的就是在json中为该列添加一个值,即,对于Billing Method列,我添加了“billingMethod”:“Sample”,然后它从那里获取它

干杯