在后台把DataTable组织成JSON,送到前台动态填充UltraWebGrid

news/2024/7/5 23:26:08 标签: json, dataset, object, microsoft, header, function

使用的库是:Newtonsoft.Json 为asp.net 3.5开发的 Beta4版本,获取数据库数据用的是

Microsoft EnterpriseLibrary 4.1

其中扩展了这个库的功能,使之最适合把DataTable,DataSet,DataRow转为JSON模式

另外使用了Jquery的$.getJSON来解析后台传过来的JSON格式

另参考了:http://blog.csdn.net/dujingjing1230/archive/2009/08/28/4495008.aspx 裴旭更网友的文章

             http://www.west-wind.com/Weblog/default.aspx  

                    一个老外MVP此人专门写了一个JSON的等一系列的库,叫什么WestWind,呵呵

 

下面是扩展的Newtonsoft.Json几个类

 

DataRowConverter.cs

 

DataSetConverter .cs

 

DataTableConverter.cs

 

Serialize.cs

 

 

调用页面前台

 

 

调用页面后台

 

igtbl_addNew("Grid", 0, false, true); 这个函数解释一下,根据API上面说的,第三个参数是加行的时候,滚动条是否跑到新加的到行

这里设成false了,所以加的时候不会跟着动,第四个参数就是是否把加的那行设为活动行(set the newly added row as the active row for the grid)


http://www.niftyadmin.cn/n/1411914.html

相关文章

一致性hash分布算法--php示例

为什么80%的码农都做不了架构师?>>> class Hash { //服务器列表 private $serverList []; //是否已经排序 private $isSorted false;//计算hash值 private function mHash($key) {//通过MD5生成32位字符串,截取前8个字符$md5 substr(md5(…

后台获得UltraWebGrid在前台修改过数据的单元格

在项目中遇到一个问题,就是用户在前台修改了单元格的数据,点提交就要更新数据,之前Grid中的数据并不多,单元格的数量只不过200~300个 就算是遍历一下,也就是更新200~300条数据,可是随着Grid的复杂程度越来越高,界面上已经有5000多个单元格了,这着实让人觉得抓狂了 …

是时候抛弃web.xml了?

你是否再为配置文件web.xml容易出错而烦恼?是否为web.xml文件存放位置而不知所措?是否为web.xml为什么要这样配?怎么才能更好的配置web.xml而烦恼?那么一种新的方式出现了: spring提供了支持servlet 3以上的编程方式&a…

前台获得UltraWebGrid修改过数据的单元格集合

function Grid_AfterExitEditModeHandler(gridName, cellId) {var grid igtbl_getGridById(gridName);var cellArray grid.ChangedCells; //得到更改过的单元格的集合for (var cell in cellArray) { if (typeof cellArray[cell] "string") { //遍历这个对象,和反射…

C#数组的学习笔记

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace Project4 {class Program{static void Main(string[] args){//主程序入口//数组空间的定义方法//int[] arr new int[10] { 1, 2, 3, 4, 5, 6…

从一个进程监控脚本学几个Linux命令(`ps`,`grep`,`awk`,`wc`)

为什么80%的码农都做不了架构师?>>> 首先来看看脚本全貌 #!/bin/sh curTimedate %Y%m%d-%H:%M count1 nums$(ps -ef | grep -E "chak.*mainClassMain" | grep -v grep | awk {print $2}| wc -w); if [ $nums -lt $count ] thencd …

两个List的交集,补集

用linq是很好实现的 using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleProgram{class Program{static void Main(string[] args){var oneList new List<int>();var twoList new List<int>();oneList.Add(1…

element UI datepicker组件限制可选日期范围

长话短说&#xff0c;简单粗暴上代码了&#xff0c;在element中的datepicker&#xff0c;可以自由选择日期&#xff0c;如下&#xff1a; 然后我们根据element 官网的文档&#xff0c;给datepicker组件动态改变 picker-options 中的 disableDate 即可对可选日期进行限制。如下&…