how to get record from store?
When I was learning examples(Custom Window with Record Details ),it always pop-up errors.
"Ext.net.Store" does not contain a definition of the "GetById".
the error code is "var record = this.GridStore.GetById(id);",How can we get the correct record??
Code:
protected void SaveEmployee(object sender, DirectEventArgs e)
{
NorthwindDataContext db = new NorthwindDataContext();
int id = int.Parse(e.ExtraParams["id"]);
Employee empl = Employee.GetEmployee(id, db);
//Company
empl.FirstName = this.FirstName.Text;
empl.LastName = this.LastName.Text;
empl.Title = this.Title.Text;
if (!string.IsNullOrEmpty(this.ReportsTo.SelectedItem.Value))
{
empl.ReportsTo = int.Parse(this.ReportsTo.SelectedItem.Value);
}
else
{
empl.ReportsTo = null;
}
empl.HireDate = this.HireDate.SelectedDate;
empl.Extension = this.Extension.Text;
//Personal
empl.Address = this.Address.Text;
empl.City = this.City.Text;
empl.PostalCode = this.PostCode.Text;
empl.HomePhone = this.HomePhone.Text;
empl.TitleOfCourtesy = this.TitleCourt.Text;
empl.BirthDate = this.BirthDate.SelectedDate;
empl.Region = this.Region.Text;
empl.Country = this.Country.Text;
empl.Notes = this.Note.Text;
db.SubmitChanges();
var record = this.GridStore.GetById(id);
this.EmployeeDetailsWindow.Hide();
CompanyInfoTab.UpdateRecord(record);
PersonalInfoTab.UpdateRecord(record);
record.Commit();
}