我如何根据条件显示网格选中(勾号) [英] I how to display grid based on conditin with checked selected (tick mark )

查看:117
本文介绍了我如何根据条件显示网格选中(勾号)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在html页面中,我正在显示下拉菜单,下拉菜单中的项目是动态的,下面的下拉菜单中显示了使用复选框的ng网格数据,这些也是动态的,动态下拉菜单中有j个数据作为

In html page i am displaying the drop down ,the item in the drop down are dynamic ,and below the drop down displaying the ng-grid data with check boxes these are also dynamic ,the dynamic drop down has the j son data as

[
  {
    "c": "D",
    "l": 1,
    "cId": 1
  },
  {
    "c": "J",
    "l": 2,
    "cId": 3
  },
  {
    "c": "G",
    "l": 3,
    "cId": 1
  }
]

在下拉菜单中,我只显示属性 c值。
动态网格具有动态j子数据作为

In drop down i have displayed only property "c" value . The dynamic grid had dynamic j son data as

 [
  {
    "c": "U t",
    "cC": "Ut",
    "cId": 1
  },
  {
    "c": "Ca",
    "cC": "CA",
    "cId": 2
  },
  {
    "c": "U i",
    "cC": "MN",
    "cId": 3
  }
{
    "c": "U i",
    "cC": "MN",
    "cId": 4
  }
{
    "c": "U p",
    "cC": "Mz",
    "cId": 5
  }
{
    "c": "U r",
    "cC": "Mc",
    "cId": 6
  }
{
    "c": "U h",
    "cC": "Mj",
    "cId": 7
  }




]

在网格i只显示vlaue的财产c:
如果我选择c:J在下拉菜单中,如果cId:3 与cid的

In grid i am showing only property of vlaue "c": If i select "c": "J" in drop down then if the "cId": 3 matched with cid of

"c": "U i",
"cC": "MN",
 "cId": 3 

其中网格中的数据显示该格式选中带有选择标记的复选框,并且如果下拉菜单中的未选择的项目 cId' s与grid匹配,则显示带有选择的复选框的网格选择标记。

whose data in grid then display that grid with check box selected with thick select mark ,and also if the unselected items in the drop down cId's are match with grid then display the grid with check box selected with light select mark .

提交网格之后的按钮,然后显示属性值c的唯一厚厚选定项目:

After submit the button below the grid then display the only thick selected items of property value "c":

有关如何执行此操作和/或代码空格的任何想法将非常欣赏。谢谢!

any thoughts on how to do this and/or a code plunkers would be greatly appreciate. Thanks!

推荐答案

所以你需要在gridOptions中指定primaryKey字段...

so you need to specify primaryKey field in gridOptions...

$scope.myData = [{name: "Moroni", age: 50, id: 101},
                 {name: "Tiancum", age: 43, id: 102},
                 {name: "Jacob", age: 27, id: 103},
                 {name: "Nephi", age: 29, id: 104},
                 {name: "Enos", age: 34, id: 105}];
$scope.gridOptions ={
    data: 'myData',
    primaryKey: 'id'
}

这篇关于我如何根据条件显示网格选中(勾号)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆