热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ASP.Net中的JQueryFlexigrid插件-JQueryFlexigridplug-ininASP.Net

IvegotanASP.NetprojectwithC#andhaveaRepeaterControlonanaspxpagethatbuildsupanht

I've got an ASP.Net project with C# and have a Repeater Control on an aspx page that builds up an html table by iterating over a datasource. I want to use the JQuery Flexigrid plug-in to make the table scrollable, but have been unable to figure out how to make it work due to lack of documentation on the plug-in. Does anyone know how to do this, or have sample code to share?

我有一个带有C#的ASP.Net项目,并在aspx页面上有一个Repeater Control,它通过遍历数据源来构建一个html表。我想使用JQuery Flexigrid插件使表格可滚动,但由于缺少插件文档而无法弄清楚如何使其工作。有谁知道如何做到这一点,或有示例代码分享?

3 个解决方案

#1


I have never used Flexigrid myself however after looking at the samples on the site I'll offer my suggestions.

我自己从未使用过Flexigrid,但在查看网站上的示例后,我会提供我的建议。

It looks like what you need to create with your repeater is a properly formatted html table with at least a thead and tbody section.

看起来你需要用你的转发器创建的是一个格式正确的html表,至少有一个thead和tbody部分。

header1 header2
table data 1 table data 2

Once done, making a simple call to the following should create the Flexigrid table with the default settings:

完成后,对以下内容进行简单调用应该使用默认设置创建Flexigrid表:

$("#mytable").flexigrid();

From there you can pass in what looks to be a ton of options to make it look as pretty as you want.

从那里你可以传递看起来很多选项,使它看起来像你想要的漂亮。

As for the repeater itself, there are a bunch of ways to set it up depending on what you need. Probably the simplest way is as follows:

至于转发器本身,有很多方法可以根据您的需要进行设置。可能最简单的方法如下:


  
    

And your data bind event would look something like this:

你的数据绑定事件看起来像这样:

public void myrepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
  myDataObject = e.Item.DataItem;
  Label data1 = e.Item.FindControl("data1");
  Label data2 = e.Item.FindControl("data2");

  data1.Text = myDataObject.data1;
  data2.Text = myDataObject.data2;
}

#2


A simple google search "asp.net+flexigrid" gave me this and this

一个简单的谷歌搜索“asp.net + flexigrid”给了我这个和这个

I must also mention that support looks to be thin on the ground for flexigrid so you maybe better looking at the better documented jqGrid

我还必须提一下,对于flexigrid来说,支持看起来很薄,所以你可能更好地查看更好的文档jqGrid

#3


Don't try to reference the table by id, you're better off using a class to identify the table. If you look at the page source you'll see that the table id isn't mytable - it's mangled by ASP.NET depending on your page structure.

不要尝试通过id引用表,最好使用类来标识表。如果你查看页面源代码,你会发现表格id不是mytable - 它会被ASP.NET破坏,具体取决于你的页面结构。


推荐阅读
  • ASP.NET2.0数据教程之十四:使用FormView的模板
    本文介绍了在ASP.NET 2.0中使用FormView控件来实现自定义的显示外观,与GridView和DetailsView不同,FormView使用模板来呈现,可以实现不规则的外观呈现。同时还介绍了TemplateField的用法和FormView与DetailsView的区别。 ... [详细]
  • 导出功能protectedvoidbtnExport(objectsender,EventArgse){用来打开下载窗口stringfileName中 ... [详细]
  • 本文介绍了OC学习笔记中的@property和@synthesize,包括属性的定义和合成的使用方法。通过示例代码详细讲解了@property和@synthesize的作用和用法。 ... [详细]
  • Android Studio Bumblebee | 2021.1.1(大黄蜂版本使用介绍)
    本文介绍了Android Studio Bumblebee | 2021.1.1(大黄蜂版本)的使用方法和相关知识,包括Gradle的介绍、设备管理器的配置、无线调试、新版本问题等内容。同时还提供了更新版本的下载地址和启动页面截图。 ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 本文介绍了Hyperledger Fabric外部链码构建与运行的相关知识,包括在Hyperledger Fabric 2.0版本之前链码构建和运行的困难性,外部构建模式的实现原理以及外部构建和运行API的使用方法。通过本文的介绍,读者可以了解到如何利用外部构建和运行的方式来实现链码的构建和运行,并且不再受限于特定的语言和部署环境。 ... [详细]
  • Ubuntu 9.04中安装谷歌Chromium浏览器及使用体验[图文]
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • 使用正则表达式爬取36Kr网站首页新闻的操作步骤和代码示例
    本文介绍了使用正则表达式来爬取36Kr网站首页所有新闻的操作步骤和代码示例。通过访问网站、查找关键词、编写代码等步骤,可以获取到网站首页的新闻数据。代码示例使用Python编写,并使用正则表达式来提取所需的数据。详细的操作步骤和代码示例可以参考本文内容。 ... [详细]
  • 欢乐的票圈重构之旅——RecyclerView的头尾布局增加
    项目重构的Git地址:https:github.comrazerdpFriendCircletreemain-dev项目同步更新的文集:http:www.jianshu.comno ... [详细]
  • Java 11相对于Java 8,OptaPlanner性能提升有多大?
    本文通过基准测试比较了Java 11和Java 8对OptaPlanner的性能提升。测试结果表明,在相同的硬件环境下,Java 11相对于Java 8在垃圾回收方面表现更好,从而提升了OptaPlanner的性能。 ... [详细]
  • Introduction(简介)Forbeingapowerfulobject-orientedprogramminglanguage,Cisuseda ... [详细]
  • 本文由编程笔记#小编为大家整理,主要介绍了markdown[软件代理设置]相关的知识,希望对你有一定的参考价值。 ... [详细]
  • 1.修改CommonSettings.props文件下compute_xx,sm_xx,其中 ... [详细]
  • 这是原文链接:sendingformdata许多情况下,我们使用表单发送数据到服务器。服务器处理数据并返回响应给用户。这看起来很简单,但是 ... [详细]
  • 目录实现效果:实现环境实现方法一:基本思路主要代码JavaScript代码总结方法二主要代码总结方法三基本思路主要代码JavaScriptHTML总结实 ... [详细]
author-avatar
mbe5757086
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有