I am using kendo UI web control, i tried to put the upload control inside the ajax binded grid, but it doesn't work within the client template.
Here is the code, please let me know what is the right way to do this.
Thanks in advance!
@(Html.Kendo().Grid<DOC>()
.Name("docGrid")
.Columns(
columns =>
{
columns.Bound(p => p.DocID).ClientTemplate("<input type='file' name='docs'/>");
columns.Bound(p => p.RequiredDocName);
columns.Bound(p => p.UploadStatus);
})
.Pageable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(30)
.Batch(false)
.ServerOperation(false)
// .Events(events => events.Error("errorHandler"))
.Model(model =>
{
model.Id(p => p.DocID);
model.Field(p => p.RequiredDocName);
model.Field(p => p.UploadStatus);
})
.Read(read => read.Action("Read", "WebApp"))))
</div>
<script type="text/javascript">
$(document).ready(function () {
$('[name=docs]').kendoUpload(
{
async:
{
saveUrl: ......
removeUrl: ........
autoUpload: true
},
upload: onUpload,
success: onSuccess
});
});
Here is the code, please let me know what is the right way to do this.
Thanks in advance!
@(Html.Kendo().Grid<DOC>()
.Name("docGrid")
.Columns(
columns =>
{
columns.Bound(p => p.DocID).ClientTemplate("<input type='file' name='docs'/>");
columns.Bound(p => p.RequiredDocName);
columns.Bound(p => p.UploadStatus);
})
.Pageable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(30)
.Batch(false)
.ServerOperation(false)
// .Events(events => events.Error("errorHandler"))
.Model(model =>
{
model.Id(p => p.DocID);
model.Field(p => p.RequiredDocName);
model.Field(p => p.UploadStatus);
})
.Read(read => read.Action("Read", "WebApp"))))
</div>
<script type="text/javascript">
$(document).ready(function () {
$('[name=docs]').kendoUpload(
{
async:
{
saveUrl: ......
removeUrl: ........
autoUpload: true
},
upload: onUpload,
success: onSuccess
});
});