i want to check condition before save but still not work what im wrong ?
how to solve it
<
p
>save: Function(e) {</
p
><
p
>var currenVar = e.model.id;</
p
><
p
>var data;;</
p
><
p
>https.get($scope.service URL + currenVar.success(function (result){</
p
><
p
>data= result;</
p
><
p
>for (item in data){</
p
><
p
>if(data[item].id == currenVar {</
p
><
p
>alert('Cannot use this');</
p
><
p
>e.preventdefault();</
p
><
p
>}</
p
><
p
>}</
p
>
Hi,
I have a scatter line chart that is supposed to show incidents that occur simultaneously. I am almost there, but have some issues I haven't been able to solve:
1) The color of the lines and markers should all be the same. As it is the color seems to be random.
2) Same goes for the tooltip, as you can see some color combinations makes for very poor visibility. I have tried to set .Color("white") on the tooltip, but it has no effect.
3) Is it possible to set the size of the chart depending on the amount of data? If there are many simultaneous incidents the chart needs to be higher.
4) I would like to have labels instead of tooltips, labels that looks like the toopltips I get when hovering over a line, but they should always be visible for all lines.Is this possible?
Best regards,
Henrik
How can I get the original values of the row when calling an update function?
My main issue is that we have a few tables where the primary key is a value we allow to be changed. However, the default auto-generated update functions will fail on update if that value is changed in the grid editor because it won't be able to lookup the row you're updating since it only knows what you want to change the value to and tries to look the row up by the new value.
How can we handle this situation?
Hi there - apologies if this is elsewhere, but I've searched and can't find an answer. I have good C# experience, but I'm relatively new to Telerik/Kendo etc,
I am aware of the AllPages(true) option for the Excel printout. What I would like to do on my Grid is to have two excel buttons, one that will export the current page, and one which will export all data.
Is this possible? From what I can see, you can only define one Excel Button on the toolbar.
Thanks in advance.I'm trying the grouping in Grid I want to display the sum of the column as ClientGroupHeaderColumnTemplate or ClientHeaderTemplate but doesn't seem to be working, it only shows as a ClientFooterTemplate. :
@(Html.Kendo().Grid<
Models.DepartmentSummaryView
> ()
.Name("grid")
.HtmlAttributes(new { style = " height:700px !important;" })
.Columns(columns =>
{
columns.Bound(p => p.DepartmentNo).Width(150).ClientGroupHeaderTemplate("Department: #= value # (Products: #= count#)");
columns.Bound(p => p.DepartmentName).Width(150).ClientGroupHeaderTemplate("Department: #= value # (Products: #= count#)");
columns.Bound(p => p.ProductNo).Width(150).ClientGroupHeaderTemplate("Product: #= value # (Count: #= count #)");
columns.Bound(p => p.ProductName).Width(150);
columns.Bound(p => p.SKU).Width(150);
columns.Bound(p => p.Qty).Width(150).ClientGroupHeaderColumnTemplate("Sum: #= sum #").ClientFooterTemplate("Sum: #= sum #");
})
.Filterable(filterable => filterable.Extra(false)
//.Mode(GridFilterMode.Row)
.Operators(operators => operators
.ForString(str => str.Clear()
.StartsWith("Starts with")
.EndsWith("Ends with")
.IsEqualTo("Is equal to")
.IsNotEqualTo("Is not equal to")
.Contains("Contains")
.DoesNotContain("Doesn't contain")
)))
//.Pageable()
.Navigatable()
.AutoBind(false)
.Sortable()
.Groupable()
.Events(events => events.DataBound("onDataBound"))
.Reorderable(reorderable => reorderable.Columns(true))
.DataSource(dataSource => dataSource
.Custom()
.Schema(schema =>
{
schema.Data("Data");
schema.Total("Total");
})
.Events(events => events.Sync("sync_handler"))
.Group(groups => groups.Add(p => p.DepartmentNo))
.Aggregates(aggregates =>
{
aggregates.Add(p => p.DepartmentNo).Count();
aggregates.Add(p => p.DepartmentName).Count();
aggregates.Add(p => p.ProductNo).Count();
aggregates.Add(p => p.SKU).Count();
aggregates.Add(p => p.Qty).Sum();
})
.Transport(transport =>
{
transport.Read(read =>
read.Url("/api/enquiries/departmentsummary)
.DataType("json")
.Type(HttpVerbs.Get)
);
transport.Create(create =>
create.Url(Base.APIHostAddress + "/api/enquiries/post")
.DataType("json")
.Type(HttpVerbs.Post)
.ContentType("application/json; charset=utf-8")
);
transport.ParameterMap("parameterMap");
})
)
)
I have got a problem where my grid columns expect a detailed name ("CityFrom" and "CityTo" - those are strings), but a method returns "Name" property. How can I map the result to the columns without duplicating the code?
Here is grid:
@(Html.Kendo().Grid<
RouteDto
>()
.Name("route-grid")
.Columns(cfg =>
{
cfg.Bound(m => m.CityFrom)
.Title("City From")
.Width(150)
.Filterable(f =>
f.Multi(true).DataSource(ds =>
ds.Read(r =>
r.Action("GetCities", "City")
)
)
);
cfg.Bound(m => m.CityTo)
.Title("City To")
.Width(150)
.Filterable(f =>
f.Multi(true).DataSource(ds =>
ds.Read(r =>
r.Action("GetCities", "City")
)
)
);
}))
Here is method:
public
ActionResult GetCities()
{
var cities = _cityService.GetCities().Select(c =>
new
{ c.Name }).ToList();
return
Json(cities, JsonRequestBehavior.AllowGet);
}
Error I am getting is in console:
Uncaught ReferenceError: CityFrom is not defined
Uncaught ReferenceError: CityTo is not defined
On grid I could use .DataTextField("Name"), but I don't have this option here. Both filters have got the same set of values - cities from database. Any ideas what can I do elegantly here?