Update: Change the parameter type of fieldformatorhandle to datarow, so that the data can be formatted based on the entire row.
2010-9-10 v1.24beta
- Fixed the bug when the insertnewrow () and updaterowdata () Methods process IDs containing "#", and adjusted some places where jquery escaping is required.
- The newly added js method containsrowid () is used to check whether the row with the specified ID exists.
- New formatting is added. Now you can use the formatting method of the specified column to process the displayed data.
- Update the demo project to display different data and cell colors based on different status fields.
- Fixed bugs that may result from conversion to webapp.
For more information, see the complete API instruction for the jquery flexigrid Asp.net solution: dotnetflexgrid control (updated to 1.24)
Update demo Program . For more information, see teststockformlist in the Quick Guide. aspx, demonstrate how to use dotnetflexgrid in a form to store data input by the customer and submit the data as a form
Column presentation template: easily display text boxes, buttons, and other things in a table
Initconfig The column configuration is added during initialization. Itemtemplate Attribute, which provides the display template setting at the forefront. You can provide almost any Html Content (of course, please ensure that the table structure is not broken), use the simple template syntax" [@ Field name ] To display your desired format, for example:
"<Input id = '[@ guid] 'Type = 'text' value =' [@ string1] '/>"
The above syntax will display Guid The ID Text Box, which will display String1 Field Value.
Format column: controls the content and color of cells based on Context data in the table.
1.24 Version, we added a Formatting Mechanism for the control. Datahandler Added Fieldformator You can perform specific formatting for the column here. The following example adds a column name for the returned data Productstate The processor, we use color to differentiate different states and display different texts.
1:Dotnetflexgrid. fieldformatorhandle proc =Delegate(Datarow Dr)
2:{
3:Switch(Dr ["Productstate"]. Tostring (). tolower ())
4:{
5:Case "0":
6:Return "<Span style = 'color: red'> disable </span>";
7:Case "1":
8:Return "<Span style = 'color: Blue '> dismounted </span>";
9:Case "2":
10:Return "<Span style = 'color: gray '> normal sales </span>";
11:Case "3":
12:Return "Sold empty";
13:}
14:Return "";
15:};
DotnetflexgridThree supported column types: data does not have to come from the database
As of the current version, the control supports three types of columns from different sources:
LNormal Column
The most common form of a column, directly fromDatahandlerTo obtain and display the data in the returned values without any additional processing.
LTemplate Column
A column is configured to display the template. The column data is generated based on the format specified in the template. The column actually exists in the data source or does not exist at all, the actual display content is determined by the running time.
LFormat Columns
If the formatting processor column is specified, the column data will be returned after the formatting method is called. If the formatting column also has template configuration, the template configuration will continue to be applied to generate new data, like the template column, this column can actually exist in the data source or does not exist at all. The actual display content is determined by the runtime.