This is a migrated thread and some comments may be shown as answers.

Kendo Grid Data source event

1 Answer 206 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tomasz
Top achievements
Rank 1
Tomasz asked on 28 Mar 2014, 02:33 PM
Hi,

I have the following kendo grid in my page:

@(Html.Kendo().Grid<Di.Service.Tracking.Models.DomainObjects.DTrackingFileEvent>()
 .Name("fileAuditing")
 .Columns(columns =>
{
columns.Bound(c => c.IsError);
columns.Bound(c => c.EventDateTime).Title(@Di.Nls.Label.Event_Date_Time);
columns.Bound(c => c.Details).Title(@Di.Nls.Label.Details);
columns.Bound(c => c.Description).Title(@Di.Nls.Label.Description);
columns.Bound(c => c.Result).Title(@Di.Nls.Label.Result);
})
.ClientRowTemplate(
"<tr bgcolor=#:IsError ? 'Pink' : 'White'# data-uid='#: uid #'>" +
  "<td>" +
  "# if(IsError == true) {# " +
"<img src='/Images/FileState/Error.gif' />" +
"#} else {# " +
"<img src='/Images/FileState/Ok.gif' />" +
"#}#" +
  "</td>" +
  "<td>#: EventDateTime #</td>" +
  "<td>#: Details #</td>" +
  "<td>#: Description #</td>" +
  "<td>#: Result #</td>" +
"</tr>"
)
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.ID))
.Read(read => read.Action("FileAuditingDetails", "FileDetails", new { iFileID = iFileID }))
.Events(e=>e.RequestEnd("onRequestEnd"))
)
)

<script>
function onRequestEnd(e) {
  //do something with event date time
}
</script>

My goal is to format the "Event date time" column so it provides a value based on the user time zone info. In order to do that I wanted to handle the "requestEnd" event, but when I do that I cannot see any data on the grid.

Removing the following line .Events(e=>e.RequestEnd("onRequestEnd")) load all the data correctly.

Any ideas how to achieve my goal?

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 01 Apr 2014, 09:30 AM
Hi Tomasz,

I would recommend checking this Code Library project, where similar behavior is illustrated.

Regards,
Alexander Popov
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

Tags
Grid
Asked by
Tomasz
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or