Home Web Front-end JS Tutorial A brief discussion on native paging of DWZ table_jquery

A brief discussion on native paging of DWZ table_jquery

May 16, 2016 pm 05:41 PM
Pagination

DWZ’s native table paging is rarely used in project development recently, and third-party data binding table plug-ins such as jqgrid or grid are often used. Now if it is required in the project, you must use DWZ’s own table

Looking at a piece of code next, I will give you a detailed introduction to how to use table paging in DWZ. The following is how it is implemented in MVC.

?


Property Introduction

targetType: binding method, DWZ provides two methods: "navTab" and "dialog". As the name implies, it means whether the paging is on the tab page or on the pop-up layer

totalCount: total number of rows of data

numPerPage: number of data rows on the current page

pageNumShown:Total number of pages

currentPage: current page number

Copy code The code is as follows:

@using (Html.BeginForm("BidPrjList", " TbUnify", null, FormMethod.Post, new { id = "pagerForm" }))
{


}

Note that the paging form under DWZ must add id="pagerForm "property, otherwise it will not be executed. The essence of the paging of tables in DWZ is to pass the paging method to the backend in the form of form submission, and the backend receives the parameters and obtains the paging information: for example:

Copy code The code is as follows:

Request.Form["numPerPage"]

The value of getting the paging information form is the name of the hidden text field you define under the pagerForm form in View. After receiving it in the background, request the paging data from the data source, and then return to the front desk.

There is a small problem here: when you enter this page for the first time, the form submission event of the current paging cannot be triggered, so above I defined the dynamic assignment of ViewBag.numPerPage, how many pieces of data are divided into each page, and the front-end interface Just define the paging style, the actual data is not bound, so the paging information passed from the front desk must be used as the basis for background data paging, so that the front desk paging can be consistent with the data and will not cause confusion. This should be noted.

In the development of actual projects, we always put tables and filter conditions together. The way to pass in restriction conditions to the table in DWZ is also very simple. As above, add the hidden text field that needs to be passed in to the paging form, for example:

Copy code The code is as follows:



In this way, the incoming filter conditions can be accepted in the background.

The essence of DWZ’s table paging is to reload the data of the current tab page, causing the tab page to be refreshed. If restrictions are used together with paging, there will be a problem. After the page is reloaded, your filter conditions will be lost, and My solution here is to add a hidden text field to the paging form. Each time the filter condition is assigned a value, it will be judged in the background whether it is empty and whether to add the filter condition. I hope everyone can pay attention to this.

One final point, targetType was introduced above, indicating that the current paging method and paging are essentially the refresh of the tab page, so if we load the View layer containing the table as a partial page asynchronously, we will find that, The paging control of DWZ will not be displayed, so paging cannot be done. I have told you above that you need to specify the type for each paging. If you use $.load or @Html.Partial, you can only load the data of the first page. , this is also a flaw in DWZ. After all, the rise of DWZ has been in recent years, and there are still many problems and bugs, especially its table paging and data binding are really difficult to use, but in general, other components of DWZ are different from The style is still very good.

Okay, that’s it for today about DWZ table paging.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP development: How to implement table data sorting and paging functions PHP development: How to implement table data sorting and paging functions Sep 20, 2023 am 11:28 AM

PHP development: How to implement table data sorting and paging functions In web development, processing large amounts of data is a common task. For tables that need to display a large amount of data, it is usually necessary to implement data sorting and paging functions to provide a good user experience and optimize system performance. This article will introduce how to use PHP to implement the sorting and paging functions of table data, and give specific code examples. The sorting function implements the sorting function in the table, allowing users to sort in ascending or descending order according to different fields. The following is an implementation form

How to create custom pagination in CakePHP? How to create custom pagination in CakePHP? Jun 04, 2023 am 08:32 AM

CakePHP is a powerful PHP framework that provides developers with many useful tools and features. One of them is pagination, which helps us divide large amounts of data into several pages, making browsing and manipulation easier. By default, CakePHP provides some basic pagination methods, but sometimes you may need to create some custom pagination methods. This article will show you how to create custom pagination in CakePHP. Step 1: Create a custom pagination class First, we need to create a custom pagination class. this

Using JavaScript to implement paging display of table data Using JavaScript to implement paging display of table data Jun 16, 2023 am 10:00 AM

As data continues to grow, tabular display becomes more difficult. Most of the time, the amount of data in a table is so large that it becomes slow to load and users need to constantly browse the page to find the data they want. This article will introduce how to use JavaScript to realize paginated display of table data, making it easier for users to find the data they want. 1. Dynamically create tables. In order to make the paging function more controllable, tables need to be created dynamically. In the HTML page, add a table element similar to the one below.

How to use JavaScript to implement table paging function? How to use JavaScript to implement table paging function? Oct 20, 2023 pm 06:19 PM

How to use JavaScript to implement table paging function? With the development of the Internet, more and more websites use tables to display data. In some cases where the amount of data is large, the data needs to be displayed in pages to improve user experience. This article will introduce how to use JavaScript to implement table paging function and provide specific code examples. 1. HTML structure First, we need to prepare an HTML structure to host tables and paging buttons. We can use <tab

Vue component practice: paging component development Vue component practice: paging component development Nov 24, 2023 am 08:56 AM

Vue component practice: Introduction to paging component development In web applications, the paging function is an essential component. A good paging component should be simple and clear in presentation, rich in functions, and easy to integrate and use. In this article, we will introduce how to use the Vue.js framework to develop a highly customizable paging component. We will explain in detail how to develop using Vue components through code examples. Technology stack Vue.js2.xJavaScript (ES6) HTML5 and CSS3 development environment

Detailed explanation of the principle of MyBatis paging plug-in Detailed explanation of the principle of MyBatis paging plug-in Feb 22, 2024 pm 03:42 PM

MyBatis is an excellent persistence layer framework. It supports database operations based on XML and annotations. It is simple and easy to use. It also provides a rich plug-in mechanism. Among them, the paging plug-in is one of the more frequently used plug-ins. This article will delve into the principles of the MyBatis paging plug-in and illustrate it with specific code examples. 1. Paging plug-in principle MyBatis itself does not provide native paging function, but you can use plug-ins to implement paging queries. The principle of paging plug-in is mainly to intercept MyBatis

How to use Layui to develop a data display page with paging function How to use Layui to develop a data display page with paging function Oct 24, 2023 pm 01:10 PM

How to use Layui to develop a data display page with paging function Layui is a lightweight front-end UI framework that provides simple and beautiful interface components and a rich interactive experience. During development, we often encounter situations where we need to display large amounts of data and perform paging. The following is an example of a data display page with paging function developed using Layui. First, we need to introduce Layui related files and dependencies. Add the following code to the <head> tag of the html page

How to implement paging function in Vue technology development How to implement paging function in Vue technology development Oct 09, 2023 am 09:06 AM

Vue is a popular JavaScript framework for building user interfaces. In the development of Vue technology, implementing paging function is a common requirement. This article will introduce how to use Vue to implement paging function and provide specific code examples. Before we start, we need to prepare some basic knowledge in advance. First, we need to understand the basic concepts and syntax of Vue. Secondly, we need to know how to use Vue components to build our application. Before we start, we need to install a paging plug-in in the Vue project,

See all articles