关键代码:

如果数据源是本地数据
$("#hidJsonData").val("[]");
   var myJsonData = [];
   if ($("#hidJsonData").val() != "") {
    myJsonData = JSON.parse($("#hidJsonData").val());
  }

$scope.myData = myJsonData ;//本地数据

$scope.gridOptionsUserRole.totalItems = myJsonData.length;    

$scope.gridOptionsUserRole.data = myJsonData;

如果数据源是url的 可以重新调用getPage

getPage($scope.gridOptions.paginationCurrentPage, $scope.gridOptions.paginationPageSize);

//getPageChooseRole($scope.gridOptionsUserRole.paginationCurrentPage, $scope.gridOptionsUserRole.paginationPageSize);

 全部取消选中
$scope.gridApi.selection.clearSelectedRows();
 
 

获取grid现有数据源,对其进行编辑后,进行刷新

$scope.refreshCheckedAccount = function () {
//$scope.gridOptionsReportAccount.totalItems = data.total;
var oldData = $scope.gridOptionsReportAccount.data ;
for(var i = 0;i<oldData.length;i++){
if (i < 5) {
oldData[i].checkedInd = true;
oldData[i].accountCode = "123";
}
}
$scope.gridOptionsReportAccount.data = oldData; $interval(function() {
$scope.gridApi.core.refresh();
}, 300, 2);
}

angularjs之UI Grid 的刷新 本地数据源及HTTP数据源的更多相关文章

  1. AngularJS +Kendo UI Grid template

    var dataSource = new kendo.data.DataSource({ transport: { dataType: "json", read: inputUri ...

  2. Kendo UI Grid 批量编辑使用总结

    项目中使用Kendo UI Grid控件实现批量编辑,现在将用到的功能总结一下. 批量编辑基本设置 Kendo Grid的设置方法如下: $("#grid").kendoGrid( ...

  3. Kendo UI Grid 使用总结

    Kendo UI Grid控件的功能强大,这里将常用的一些功能总结一下. Kendo UI Grid 固定列 在使用Gird控件显示数据时,如果数据列过多,会出现横向滚动条,很多情况下,我们希望某些列 ...

  4. 刷新本地的DNS缓存数据

    ipconfig /flushdns”执行,刷新本地的DNS缓存数据. ipconfig /displaydns      查看本地DNS缓存记录的命令为:ipconfig /displaydns.你 ...

  5. AngularJs的UI组件ui-Bootstrap分享(一)

    最近几个月学习了AngularJs和扩展的UI组件,并在公司小组内做了一次分享交流,感觉很有收获,在此记录下个人的学习心得. 目录: AngularJs的UI组件ui-Bootstrap分享(一) A ...

  6. AngularJs的UI组件ui-Bootstrap分享(十四)——Carousel

    Carousel指令是用于图片轮播的控件,引入ngTouch模块后可以在移动端使用滑动的方式使用轮播控件. <!DOCTYPE html> <html ng-app="ui ...

  7. AngularJs的UI组件ui-Bootstrap分享(十三)——Progressbar

    进度条控件有两种指令,第一种是uib-progressbar指令,表示单一颜色和进度的一个进度条.第二种是uib-bar和uib-progress指令,表示多种颜色和多个进度组合而成的一个进度条. 这 ...

  8. AngularJs的UI组件ui-Bootstrap分享(十二)——Rating

    Rating是一个用于打分或排名的控件.看一个最简单的例子: <!DOCTYPE html> <html ng-app="ui.bootstrap.demo" x ...

  9. AngularJs的UI组件ui-Bootstrap分享(十一)——Typeahead

    Typeahead指令是一个用于智能提示或自动完成的控件,就像Jquery的AutoComplete控件一样.来看一个最简单的例子: <!DOCTYPE html> <html ng ...

随机推荐

  1. MySQL数据库(二)

    1.模糊查询like 在where 后面使用like 通配符: % 任意字符 _ 单个字符 2.order by 排序 order by price //默认升序排序 order by price d ...

  2. what eats up the performance in the interior scene?

    - baseline (7w rps/core) - switch from large accelerator to regular accelerator (9w rps/core) - repl ...

  3. MongoDB高级知识-易扩展

    MongoDB高级知识-易扩展 应用程序数据集的大小正在以不可思议的速度增长.随着可用宽带的增长和存储器价格的下跌,即使是一个小规模的应用程序,需要存储的数据也可能大的惊人,甚至超出了很多数据库的处理 ...

  4. day02.4-字典内置方法

    字典——dict的定义:test = {"k1":18,2:True,"k3":[11,22,("zi","zai")] ...

  5. bzoj1833数字计数

    题目链接 找$[1$ ~ $a-1]$和$[1$ ~ $b]$中各数码出现的次数之后相减就是答案 上代码: /********************************************* ...

  6. jquery源码解析:jQuery静态属性对象support详解

    jQuery.support是用功能检测的方法来检测浏览器是否支持某些功能.针对jQuery内部使用. 我们先来看一些源码: jQuery.support = (function( support ) ...

  7. Hibernate入门教程

    Hibernate 随心所欲的使用面向对象思想操纵数据库. Table of contents 介绍 搭建开发环境 半sql半面向对象写法 完全的sql写法 完全的面向对象写法 Hibernate H ...

  8. 如何解决 “invalid resource directory name”, resource “crunch”

    Ant and the ADT Plugin for Eclipse are packing the .apk file in a different build chain and temp gen ...

  9. urllib和urllib3

    urllib库 urllib 是一个用来处理网络请求的python标准库,它包含4个模块. urllib.request---请求模块,用于发起网络请求 urllib.parse---解析模块,用于解 ...

  10. Scrapy——settings配置文件

    # -*- coding: utf-8 -*- # Scrapy settings for tencent project # # For simplicity, this file contains ...