ExtJS with. NET Development Instance series:
1.ExtJS with. NET Development example (Grid data display, paging, sorted)
2.ExtJS with. NET Development example (bulk delete article in grid)
Thank you for your attention to the two articles, I will try my best to help the friends who need to use the ExtJS development to solve the problems encountered in the development.
Again, the steps we add to the logging feature are as follows:
1. New FORM
The form is built with ExtJS implementation in the Gridforprojectlists.js file. Note that I also made a ExtJS combobox.
ComboBox implementation:
1var storeDept = new Ext.data.Store({
2 proxy: new Ext.data.HttpProxy({
3 url:"../Projects/JsonDataSource/DepartmentInfo.aspx"
4 }),
5 // create reader that reads the project records
6 reader: new Ext.data.JsonReader({}, [
7 {name:'Text',type:'string'},
8 {name:'Value',type:'string'}
9 ])
10 });
11 storeDept.load();
12
13 var storeStatus = new Ext.data.Store({
14 proxy: new Ext.data.HttpProxy({
15 url:"../Projects/JsonDataSource/GetProjectStatus.aspx"
16 }),
17 // create reader that reads the project records
18 reader: new Ext.data.JsonReader ({},[
19 {name:'NAME',type:'string'},
20 {name:'CODE',type:'string'}
21 ])
22 });
23
Storestatus.load (); Here the implementation of the two ComboBox, one is the department selection, one is the state selection. I am here to say only one of the data sources, namely getprojectstatus.aspx.
Create a new getprojectstatus.aspx file with the following code:
Getprojectstatus.aspx
1<%@ Page language= "C #" autoeventwireup= true "codebehind=" GetProjectStatus.aspx.cs "inherits=" Web.Projects.JsonDataSource.GetProjectStatus "% >
2<%=strjsonsource%> 1using System;
2using System.Data;
3using System.Configuration;
4using System.Collections;
5using System.Linq;
6using system.web;
7using System.Web.Security;
8using System.Web.UI;
9using System.Web.UI.WebControls;
10using System.Web.UI.WebControls.WebParts;
11using System.Web.UI.HtmlControls;
12using System.Xml.Linq;
13using businessobject.projects;
14using Database;
15using web.components;
16namespace Web.Projects.JsonDataSource
17 {
Partial class GetProjectStatus:System.Web.UI.Page
19 {
Protected string Strjsonsource = String. Empty;
protected void Page_Load (object sender, EventArgs e)
22 {
Getjsonsoucestring ();
24}
25
26//These do not need me to comment on it, hehe
The private void getjsonsoucestring ()
28 {
Projectdictdatacontext db = new Projectdictdatacontext ();
var query = from P in db. Project_dicts
where P.dict_type = "003"
Select New {p.name, p.code};
Strjsonsource = query. Tojson ();
34}
35}
36}
37