Hi,
When I edit an activity in my gantt I have many fields in the popup edit including a multiselect. This multiselect should be different for each activity.
For load the datasource I put the code below in my function Gantt edit :
<p>
$.get(
'/Activity/ReadMultiSelectActivities?initiativeId='
+ @Model.ID +
'&excludeSectorId='
+ $(
'#SectorID'
).val() +
"&activityID="
+ e.task.id,
function
(data, status) {<br> allActivitiesDataSource =
new
kendo.data.DataSource({<br> data: data.Data,<br> group: { field:
"SectorName"
},</p><p> sort: { field:
"ActivityNumberString"
, dir:
"asc"
}<br> });<br>});</p>
When I go the first time on my edit activity the list is empty but if I go an second time the list is OK. Then if I go on an other activity, the previous list is displayed.
It's like my list is charge after the display of my popup edit.
I try many things. Like use refresh(), data.read(), put some code in the multiselect Databound... But nothing work!
Do you know how to do it please?
Thanks for advance
I used the MVC example which works perfect as-is I rewrote to work with a JSON request and it ALSO works fine, however when I try to view the data in a string it is trying to display the OBJECT and not the data inside the object. I ASSUMED that the SelectedData is also in JSON format becuase the MultiSelect datasourse is a JSON object.
@(Html.Kendo().MultiSelect()
.Name("GridSelect")
.AutoClose(false)
.Placeholder("Select Which Grids to Print...")
.DataTextField("MapName")
.DataValueField("Pagenumber")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetCascadeGrid100", "GridPrint")
.Data("filterGrid100");
})
.ServerFiltering(true);
})
)
So my issue is when I create click button function and I want to display the selected items.. here is what I have tried and the results. I just want to display my data in a string Mapname:1 PageNumber:234, Mapname:3, PageNumber:3244 etc...
$(document).ready(function () {
var Gridselect = $("#GridSelect").data("kendoMultiSelect");
$("#get").click(function () {
alert( Gridselect.value + ", " + Gridselect.text + ",");
// this displays nothing but the commas
// Also have tried
var output = '';
for (var entry in Gridselect) {
output += 'key: ' + entry + ' | value: ' + Gridselect[entry] + '\n';
}
alert(output);
// This displays a bunch of data but none of my values, it seems to parse the PageNumber and the MapName so there is something in there.
// Also Tried
alert(Gridselect.toSource);
});
});
I have an editable grid using InCell as the Edit Mode. I have one field that is editable. When that cell gets focus I want it to select the contents of the cell. So for instance if the cell contains "100" and it gets focus I want the "100" to be selected so that the user can type over it with out having to backspace. I have tried putting a this.select(); in the onEdit Code when that column is being edited but it isn't working.
Thx for help
Lee
I am trying to capture the filter event in my Kendo grid as we are saving grid state in Local storage using Angularjs. Server-side filter works, but the "filter event" on the grid does not fire. Is there something more I need to do? Here is a code snippet
pageSize: 25,
serverPaging: true,
serverFiltering: true,
serverSorting: true
}),
width: "100%",
sortable: true,
reorderable: true,
pageable: true,
columnMenu: false,
resizable: true,
filterable: true,
filter: function(e) {
if (e.filter == null) {
console.log ("filter has been cleared");
} else {
console.log(e.filter.logic);
alert(e.filter.filters[0].field);
console.log(e.filter.filters[0].operator);
console.log(e.filter.filters[0].value);
}
},
you can set save / cancel buttons text buy UpdateText and CancelText of command.Edit()
columns.Command(command => { command.Destroy().Text(" "); command.Edit().HtmlAttributes(new { style = " " }).Text(" ").UpdateText("Сохранить").CancelText("Отмена"); }).Width(100);
what if I need only delete button present in grid? (so user can add or delete items)?
if I remove edit command I will get default button names. If I set command.Edit(). HTMLAttributes display to none I will get no edit button but also I get NO save update buttons in popup
I am using Kendo Spreadsheet for ASP.Net MVC and using it inside the Kendo window.
I need to customize the spreadsheet toolbar to add a custom button (Save) option for the users to save the spreadsheet.
I could see the reference for toolbar customization using Kendo UIJavascript , but not with MVC. Please suggest how to add a custom button in spreadsheet toolbar using MVC.
This seems like it should be fairly simple and yet here I am.
I have a grid with inline editing. I have set an editor template for a column to have a dropdown list. This column is bound to a property that is set according to an enum. All of that works great, and I get a dropdown with the names.
However, it always posts to the database as null. All I want is the dropdown to show names when editing, post the value when creating or editing, then display the name when just viewing.
I have scoured forums but continue to come up empty.
Model
public
class
Issue
{
public
int
Id {
get
;
set
; }
...
...
public
Urgency? Urgency {
get
;
set
; }
...
...
}
Enum
public
enum
Urgency
{
Low = 1,
Medium = 2,
High = 3,
Critical = 4
}
EditorTemplate View
@(Html.Kendo().DropDownList()
.Name(
"Urgency"
)
.BindTo(Enum.GetNames(
typeof
(Urgency)).ToList())
)
I have tried many other things but this is where my code is at the moment.
What am I missing?
I'm trying to implement filter checkboxes with my dynamic column grid. I return a List<string> of options that I retrieve based on the PropertyName that I pass to the read action of the Filterable property.
I keep getting the following javascript error, where X33 is the generic column name that is mapped to the actual data column. Any advice would be great.
VM2049:3 Uncaught ReferenceError: X33 is not defined
at eval (eval at compile (kendo.all.min.js:25), <
anonymous
>:3:209)
at Object.render (kendo.all.min.js:25)
at Object.d [as render] (jquery.min.js:2)
at init.createCheckBoxes (kendo.all.min.js:43)
at init.refresh (kendo.all.min.js:43)
at init.options.forceUnique.checkChangeHandler (kendo.all.min.js:43)
at init.trigger (kendo.all.min.js:25)
at init._process (kendo.all.min.js:28)
at init.success (kendo.all.min.js:27)
at success (kendo.all.min.js:27)
Here is the relevant code for setting up the columns.
foreach (ColumnSettings col in Model.GridColumns)
{
columns.Bound(col.PropertyName).Title(col.Title).Width(col.Width).Filterable(ftb => ftb.Multi(true)
.DataSource(ds => ds.Read(r => r.Action("Unique", "Data").Data("{ field: '" + col.PropertyName + "' }"))));
}