Hi,
I am trying to implement Grid Ajax but when I click on page 2 the grid is set to 1st page.
following is the view:
@(Html.Kendo().Grid(Model).Name("baseUserInfoGrid")
.Columns(columns => {
columns.Bound(m => m.User_Id);
columns.Bound(m => m.Name);
columns.Bound(m => m.Email);
}).Pageable().Groupable().Sortable()
.DataSource(a => {
a.Server().Read("Index", "Admin");
a.Ajax().Read("_Index", "Admin"); })
)
and Actions:
public ActionResult Index()
{
return View(GetBaseUserInfo());
}
[GridAction]
public ActionResult _Index()
{
return View(GetBaseUserInfo());
}
am I missing something?
Regards,
Yeou
categoryAxis.type: "Date".max NumberThe last date displayed on the axis. By default, the minimum date is the same as the last category. This is often used in combination with the min configuration option to set up a fixed date range.var aDataSource = new kendo.data.DataSource({yaddayaddayadda});var bDataSource = new kendo.data.DataSource({yaddayaddayadda});var cDataSource = new kendo.data.DataSource({yaddayaddayadda});function readDataSources() { bDataSource.read(); cDataSource.read();}; $(document).ready(function () { $("#aGrid").kendoGrid({ dataSource: aDataSource, autobind: true }); $("#bGrid").kendoGrid({ dataSource: bDataSource, autobind: false }); $("#cGrid").kendoGrid({ dataSource: cDataSource, autobind: false });})property.
Column definitions in the grid look like:
columns:[
{field:"Name", title:"Product"},
{field:"IsValid", title: "State"}
]
What I actually want is a column that should behave like:
{field:"IsValid", title: "State"
, template: {
function(model) {
if(model.IsValid && model.Count > 0)
return "<img src ='images/good.png'/>";
else return "<img src ='images/bad.png''/>";
}
}
}
According to the - much better - documentation, "template" property expects a string, but is it possible to add some JavaScript code to the template string as well, something like
var imgTemplate = kendo.template(
"#if (model.IsValid && model.Count > 0){#<img src='icons/A.png'/>#}#else {#<img src='icons/B.png'/>#}#");
and in the columns definitiontemplate: imgTemplate(model)
public class BusinessUserAccountModel : BusinessUserBaseModel
{
public IEnumerable<Accounts> Accounts { get; set; }
public BusinessUserAccountModel(){}
public BusinessUserAccountModel(BusinessData businessData,IEnumerable<Accounts> accts) : base(businessData, BusinessTab.Accounts)
{
Accounts = accts;
}
}
As you see above BusinessUserAccountModel is further inheriting BusinessUserBaseModel. If somehow in my grid CRUD operations if i able to pass BusinessUserAccountModel class along with the Accounts Collection that will solve my problem.
Just for more clarification in my page I have other controls in my page other than grid, so whenever I do CRUD operation in the grid those controls validation should also get fired. Hope you got cleared with my problem.
Thanks,
Nandan
{
id : "1",
name : "Ted",
collection : [ { id :"1" , name : "Picture 1 "}, { id :"2" , name : "Picture 2 "}]
}