jqGrid Form plug-in source code overview

sponsored links
As jQuery form plugin, jqGrid I think is the best, the article has some good reading foundation jqGrid

For everyone reading this article one, two notes for themselves, if error, please let us know!

Open jqGrid the src folder following

Css is the style sheet

I18n localization files are

The following is the main js files

jqGrid Form plug-in source code overview


First, non-jqGrid own

jqDnR.js Drag'n'Resize drag and stretch

jquery.searchFilter.js query

jquery.fmatter.js format

JsonXml.js xml conversion json, pure js, non-jquery plugin

jqModal.js mask layer, jquery plugin

Second, jqGrid basic js

grid.base.js structure:

1): jquery extension to a jqrid function $. Extend ($. Jgrid ,{}), use, such as $. Jgrid.htmlDecode (value)

2): the main production of plug-ins (80 rows around) $. Fn.jqGrid = function (pin) ()

Mainly includes:

1, sorting can sort sortable in the decision by the colModel

2, subGrid

3, ondblClickRow function (rowid) ()

4, onRightClickRow function (rowid) ()

5, onSelectRow function (rowid) ()

6, multiselect multiple choice, default false

7, treeGrid

8, toolbar, customizable toolbar

9, scroll to this and rowlist [] mutually exclusive, when the scroll is true when, rowlist [] an immediate value will be set to rowlist [] initial null value

10, rownumbers automatically generate client-side serial number

The main functional areas in the statement of around 377 lines to 1169 lines around the end of the main features are included in the code

About 1195 lines to 1219 lines declare the default xmlReader and jsonReader structure parameters can be set jqGrid changes, such as: jsonReader: (repeatitems: true, cell: "cell", id: "keyid")

1124 lines to 1250 lines grid structure around the table first, and about 1250 lines to 1351 lines for the header of the function of binding

3): Opening of the API interface (near line 1619) $. Jgrid.extend (())

Main API interface getGridParam and setGridParam, you can get or set the parameters

getGridParam methods:

getGridParam ("url") the current url from options array for the current AJAX 's URL

getGridParam ("sortname") the name of last sorted column to sort the field

getGridParam ("sortorder") the last sorted order sort order

getGridParam ("selrow") the id of the selected row, null if row is not selected very useful, get selected row ID

getGridParam ("page") the current page number. the current page

getGridParam ("rowNum") the current number of requested rows present the number of places

getGridParam ("datatype") the current datatype. get the current datatype

getGridParam ("records") the current number of records in grid. are the total number of records

getGridParam ("selarrrow") array of id's of the selected rows when multiselect options is

true. Empty array if not selection. can be multiple choice, the return selected row ID

setGridParam methods:

setGridParam ((url: newvalue)) Parameters: url - string Set a new url, replacing the older.

Can set a grid of the ajax url, be compatible with the trigger ("reloadGrid") to use

setGridParam ((sortname: newvalue)) Parameters: sortname - string Set a new sort name

Set sort field

setGridParam ((sortorder: newvalue)) Parameters: sortorder - string (asc or desc) Set a new sort order

Set the sort order asc or desc

setGridParam ((page: newvalue)) Parameters: page - integer> 0 Set a new page number

Turn to the first few pages set

setGridParam ((rowNum: newvalue)) Parameters: rownum - integer> 0 Set a new number of requested rows.

Set the current number of rows per page

setGridParam ((datatype: newvalue)) Parameters: datatype-string xml, json.xmlstring, jsonstring, clientSide) Set a new datatype.

Set up a new datatype (xml, json)

grid.loader.js jqGrid load all the necessary components, This file should be used if you want to debug, if you need to load the debug on

grid.formedit.js and form-related to add, delete, modify, view, refresh, query, FormToGrid, GridToForm so, the file extensions more

3, jqGrid colModel allocation table structure

align left, center, right

detefmt date: true

editable flase

editoptions edittype a prerequisite, this is the value, []

editrules edit specification

edittype text, textarea, select, checkbox, password

formatoptions

formatter

hidedlg false (appear in the modal dialog)

hidden false if hidden columns in the loading

index used for ranking the most convenient is to set a database field

jsonmap statement json format

key false

When not set colNames label when used in the bar at this place, this also is empty, is the name instead of

name the necessary attributes of a unique identifier, such as pop-up editform form, will serve as the input of the name attribute

resizable true, the column width can be adjusted

search true

sortable true

sorttype text, int, float, date

width 150

xmlmap statement format xml

-------------------------------------------------- -------------------------------------------------- ----------------------------

Another: When the grid is not to table structure, so a div, it will go wrong
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of jqGrid Form plug-in source code overview

  • Struts + Spring + Hibernate practice

    Tools: Eclipse3.1, MyEclipse4.03, Tomcat5.5.9, Properties Editor plug-ins, MySql4.1.13 New construction: the name for the login Create Struts framework Create index.jsp, add a link to login.jsp Press Ctrl + N, to create login.jsp, LoginAction, the use of

  • javascript built-in functions Info

    48. In the old browsers do not perform this JS :<!-- //--> 49. To quote a document-style JS: <script type="text/javascript" src="/blog/aaa.js"> </ script> 50. Specified in the script does not support the browser displ

  • SUI-JavaScript rich UI library integration solution

    Introduction: SUI is not a class implementation of the UI, nor is it a standard set of UI markup language, it is just to help the existing UI frameworks (such as Ext, YUI like) to mark the way to the statement and the creation of UI. The names of these ta

  • Msxml2.XMLHTTP version problem

    Projects with an import feature prototype.js of Ajax functionality to update the prompt, the code is very simple, do not have the framework of the background on a jsp to output Text, future use of timers and to update the page Ajax.request encountere ...

  • JS after ajax request return of the problem can not be implemented

    1: Send ajax request, in the onComplete, if back when the html contains a javascript, then these javascrip and will not be realized, it does not mean not to implement. This problem has troubled me for a long time, behind the hair and then put this kn ...

  • jBPM Development Getting Started Guide

    Although the workflow is still immature stage of development, not even a recognized standard. But its application has already been launched in the Express, indicating the market's demand for job-flow framework are urgent and enormous. Backgrounds of o

  • Openfire Plugin Developer's Guide

    Introduction Openfire features plug-ins are enhanced. This document is a guide to developers to create plug-ins. The structure of a plug-in Plug-ins Plug-ins openfireHome stored in the directory. When deploying a plug-in jar or war file, it will automatic

  • js events dynamically add and write-off

    IE's JScript existence of memory leak bug must we all know or have heard of. This is because of IE's memory recovery manager of a design error. When we create a prepared script when a cross-reference, for example, the following code: window.o ...

  • Use Ext JS to read the JsonReader complex object json

    Today was how to resolve the following complex json object to the difficult living over a long time .. did not find documentation how to read JsonReader Ways json object (possibly also because of their limited level of E the text did not correctly underst

  • hibernate (jpa) composite primary key annotation statement Ways

    In the design of the database tables are designed with a composite primary key of the table, that table's record by more than one field joint identification, such as: Table CREATE TABLE TB_HOUR_DATA ( STAT_DATE DATE NOT NULL, PATH_ID NUMBER(20) NOT NULL,

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries