hi,
in my AngularJS app I've bound the Kendo Grid to a SharePoint 2010 REST Webservice and defined it as follows:
001.$scope.mainGridOptions = {002. 003. filterable: {004. extra: false,005. messages: {006. info: "Datensätze filtern:",007. filter: "Filtern",008. clear: "Löschen",009. and: "und",010. or: "oder"011. },012. operators: {013. string: {014. contains: "beinhaltet",015. eq: "ist gleich",016. neq: "ist nicht gleich"017. },018. date: {019. eq: "ist gleich",020. gt: "nach",021. lt: "vor"022. },023. number: {024. eq: "ist gleich",025. gt: "größer als",026. lt: "kleiner als"027. },028. }029. },030. sortable: true,031. scrollable: false,032. pageable: {033. previousNext: true,034. numeric: true,035. refresh: true,036. pageSizes: [5, 10, 25],037. messages: {038. display: "{0} - {1} von insgesamt {2}",039. empty: "Keine Daten",040. itemsPerPage: "Datensätze pro Seite",041. refresh: "Neu laden"042. }043. },044. dataSource: new kendo.data.DataSource({045. type: "odata",046. transport: {047. read: {048. url: $scope.filterParams.url,049. dataType: "json"050. }051. },052. sort: ({ field: "Erstellt", dir: "desc" }),053. pageSize: 5,054. resizable: true,055. serverSorting: true,056. serverFiltering: true,057. serverPaging: true,058. schema: {059. model: {060. fields: { 061. Erstellt: { type: "date" },062. ErstelltVon: {063. Name: {064. type: "string"065. }066. },067. Geändert: { type: "date" },068. GeändertVon: {069. Name: {070. type: "string"071. }072. }073. }074. }075. }076. }),077. columns: [ 078. {079. field: "ErstelltVon.Name",080. title: "Erstellt von",081. width: "130px"082. 083. },084. {085. field: "Erstellt",086. title: "Erstellt am",087. width: "130px",088. type: "date",089. format: "{0:dd.MM.yyyy HH:mm:ss}",090. parseFormats: ["dd.MM.yyyy"],091. template: '#= kendo.toString(new Date(data.Erstellt.getTime() + data.Erstellt.getTimezoneOffset()*60000), "dd.MM.yyyy HH:mm:ss tt") #'//Timezone correction092. },093. {094. field: '["GeändertVon"].Name',095. title: "Geändert von",096. width: "130px"097. 098. },099. {100. field: '["Geändert"]',101. title: "Geändert am",102. width: "130px",103. type: "date",104. format: "{0:dd.MM.yyyy HH:mm:ss}",105. parseFormats: ["dd.MM.yyyy"],106. template: '#= kendo.toString(new Date(data.Geändert.getTime() + data.Geändert.getTimezoneOffset()*60000), "dd.MM.yyyy HH:mm:ss tt") #' //Timezone correction107. }108. 109. ]110. }
this is a part of the data from the REST Service:
1.<d:Geändert m:type="Edm.DateTime">2015-08-04T09:31:53</d:Geändert>2.<d:Erstellt m:type="Edm.DateTime">2015-07-28T11:06:19</d:Erstellt>
all of the data is displayed correctly.
the problem is the filter menu.
On the "Erstellt" field it displays the options for a date-type (eq, lt, gt) which i've defined.
On the "Geändert" field it displays the options i defined for string-types, although i've declared it as a date field.
Thank you!!
Is there anyway to make the gantt chart print over multiple pages? Currently when I export it to PDF and it looks good. However when ​I attempt to print it the chart shrinks to fit the screen and becomes unreadable. If I uncheck "fit to screen" it only prints one page and the upper left corner of the graph. Unfortunately I know our clients will want the ability to print so saving paper and not printing is not an option.
There is a
problem with inline editing, when drag and drop are allowed.
Try your
example: http://dojo.telerik.com/uRaza
Here I can
mouseclick in the two cells and change the values - perfect.
But replace:
editable: "inline" with:
editable: {
move: true,
mode: 'inline'
}
Then it’s
not possible to change values in both cells.
While there are plenty of read/update/delete examples out there for using Angular JS + Odata + Kendo UI, I have not yet come across a CREATE/POST example...and I am struggling with the right method to basically insert form entered data to an odata service via the kendo model and datasource.
I have an Orders Kendo Data Model
myApp.factory('orderModel', function ()
{
return kendo.data.Model.define({
id: "OrderID",
fields: {
OrderID: { type: "int", editable: false },
Amount: { type: "number", required: true, min: 1 },
Heading: { type: "string", required: true },
Message: { type: "string" },
PurchaseDate: { type: "date" }
}
});
});
And I have an Orders DataSource:
function dsOrders(orderModel) {
var crudServiceBaseUrl = "/odata/Order";
return new kendo.data.DataSource({
type: "odata",
transport: {
read: {
async: true,
url: crudServiceBaseUrl,
dataType: "json"
},
create: {
url: "/odata/Orders",
type: "post",
dataType: "json",
},
update: {
url: function (data) {
return crudServiceBaseUrl + "(" + data.OrderID + ")";
},
type: "put",
dataType: "json"
},
destroy: {
url: function (data) {
return crudServiceBaseUrl + "(" + data.OrderID + ")";
},
dataType: "json"
}
},
batch: false,
serverPaging: true,
serverSorting: true,
serverFiltering: true,
pageSize: 10,
schema: {
data: function (data) { return data.value; },
total: function (data) { return data["odata.count"]; },
model: orderModel
},
error: function (e) {
alert(e.xhr.responseText);
}
});
};
My Angular controller creates a new empty instance of an order. The user makes selections that set the values to the scope and we call a save method that does the following:
$scope.send = function () {
//instantiate the orders datasource
var datasource = new dsOrders();
var item = {
Amount: $scope.order.Amount,
Heading: $scope.order.Heading,
Message: $scope.order.Message
};
dataSource.add(item);
dataSource.sync();
}
Nothing is happening here - the create event doesn't fire, nothing goes to the odata controller, etc. If anyone has a good example of CREATE/POST using AngularJS, or any suggestions for the proper way to implement what I am attempting to achieve, I would greatly appreciate it.
Hello,
Can we build the plot bands with dynamic data. In this example http://demos.telerik.com/kendo-ui/bar-charts/plotbands here the values for plot bands are hard coded. Can we specify the values from web service here?
Best Regards,
Devendra
I currently have a template that displays a date (among other things). When I was initially setting this up, I was told to use "#= kendo.toString(kendo.parseDate(data.CompletedDate), 'dd-MMM-yyyy') #" to display this date in the required format, which works perfectly.
Now I am attempting to move that date formatting into the datasource, in anticipation of future functionality. I found the dataSource -- schema -- parse functionality and thought it would work for what I wanted, but the formatting isn't actually working.
Datasource:
var datasource = new kendo.data.DataSource({ transport: { read: { type: "GET", url: "/MainController.cfc?method=getCourses", processData: true, dataType: "json", data: { CourseData: JSON.stringify(course_data) } } }, schema : { type: "json", data: "Courses", parse: function (data) { $.map(data, function (item, index) { if (typeof(item.Due) !== "undefined" && item.Due != null) { item.Due = kendo.parseDate(item.Due, "dd-MMM-yyyy"); } }); return data; } }});Here's a sample of the JSON being returned to the datasource:
{"Courses":[{"HasTasks":1,"EnrollmentSubscription":0,"IncompletePrereqs":0,"AllowReenroll":0,"GradeDisplay":1,"CompletionAccess":1,"EnrollType":"Enrolled","Due":"07\/23\/2015","CompletedDate":"","SelfEnrollCount":0,"EnrolledBy":331786,"HasAssessment":0,"SubscriptionExpired":0,"Completed":0,"EnrollmentGroup":0,"DueStatus":"","Tag":"","Type":"Online","PreviouslyComplete":1,"Certificate":1,"Name":"Completed (Auto re-enroll)","Grade":"","Started":1,"Progress":0.0,"Image":"","AULMRID":501507,"MergeDoc":0,"Passed":0,"LearningModuleID":20437,"CourseID":5570,"ExpirationAccess":1}]}When the template is displayed, the date is showing in mm/dd/yyyy format, not the specified dd-MMM-yyyy format. I copied the format string directly from the template code, so what's the problem?