Люди добрые, помогите кто сможет. Сижу уже месяц не могу разобраться.У меня следущий код...
WebService:
//=========================================================================================
// Returns dataset from ANY table
//=========================================================================================
[WebMethod(Description = "Cycle: Returns rows from this table")]
//public DataSet SelectCycle(int id, string table_name)
public XmlDocument SelectCycleXml()
{
int id = 0;
String table_name = "faculty";
SqlConnection con = new SqlConnection();
con.ConnectionString = connectionStringASUU;
string usp_name = "";
switch (table_name)
{
case "cycle_type":
usp_name = "usp_SelectCycle_Type";
break;
case "cycle":
usp_name = "usp_SelectCycle";
break;
case "faculty":
usp_name = "usp_SelectFaculty";
break;
case "OKR":
usp_name = "usp_SelectOKR";
break;
case "department":
usp_name = "usp_SelectDepartment";
break;
case "direction":
usp_name = "usp_SelectDirection";
break;
case "speciality":
usp_name = "usp_SelectSpeciality";
break;
case "contingent":
usp_name = "usp_SelectContingent";
break;
case "study_plan":
usp_name = "usp_SelectStudy_plan";
break;
case "work_study_plan":
usp_name = "usp_SelectWork_study_plan";
break;
case "study_plan_detail":
usp_name = "usp_SelectStudy_plan_detail";
break;
case "discipline":
usp_name = "usp_SelectDiscipline";
break;
}
SqlCommand cmd = new SqlCommand(usp_name, con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@id", SqlDbType.Int));
cmd.Parameters["@id"].Value = id;
cmd.Parameters.Add(new SqlParameter("@ok", SqlDbType.SmallInt));
cmd.Parameters["@ok"].Direction = ParameterDirection.Output;
try
{
con.Open();
XmlDocument xmlDoc = new XmlDocument();
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, "Results");
xmlDoc.LoadXml(ds.GetXml());
return xmlDoc;
// return ds;
}
finally
{
con.Close();
}
}
ExtJS:
var xmlread = new Ext.data.XmlReader({
totalRecords: 'NewDataSet',
record: 'Results',
id: 'id'
}, ['id','full_name','short_name','info'])
var xmlProxy = new Ext.data.HttpProxy(
{
// for resding xml data from WebService
method: 'POST',
url: 'http://localhost/virtualtest1/Service.asmx/SelectCycleXml'
})
var ds = new Ext.data.Store({
proxy: xmlProxy ,
reader: xmlread
});
Ext.onReady(function(){
// data grid
var grid = new Ext.grid.GridPanel({
renderTo: document.body,
frame:true,
title: 'Faculty grid',
height:200,
width:500,
store: ds,
columns: [
{header: "ID number", dataIndex: 'id'},
{header: "FULL NAME", dataIndex: 'full_name'},
{header: "SHORT NAME", dataIndex: 'short_name'},
{header: "ADDITIONAL INFORMATION", dataIndex: 'info'}
]
});
});
После выполнения я получаю пустой грид...
Помогите, скажите где ошибка или чего нехватает