Hi,
I am a newbie to Kendo so apologise in advance if my question is missing the bleeding obvious.
I have a custom command button in my grid which I have bound to a function (called uploadFile). My ultimate intention is to allow the user to click a button to bring up a modal window which will allow them to upload a file to the server. I am able to get the Upload button displaying and firing properly. However, I cannot find any information on how to derive the ID of the row from which the button was clicked.
Code is:
Can anyone point me in the right direction? Many thanks in advance for taking the time to look at this.
Tom
I am a newbie to Kendo so apologise in advance if my question is missing the bleeding obvious.
I have a custom command button in my grid which I have bound to a function (called uploadFile). My ultimate intention is to allow the user to click a button to bring up a modal window which will allow them to upload a file to the server. I am able to get the Upload button displaying and firing properly. However, I cannot find any information on how to derive the ID of the row from which the button was clicked.
Code is:
$(document).ready(
function
() {
var
crudServiceBaseUrl =
"StudentProxyKendo.cfc?method="
,
dataSourcePEP =
new
kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl +
"getPEP&studentID="
+ studentID +
"&laId="
+ laId +
"&schoolID="
+ schoolID,
dataType:
"json"
},
update: {
url: crudServiceBaseUrl +
"updatePEP"
,
dataType:
"json"
,
type:
"POST"
},
destroy: {
url: crudServiceBaseUrl +
"deletePEP"
,
dataType:
"json"
,
type:
"POST"
},
create: {
url: crudServiceBaseUrl +
"addPEP"
,
dataType:
"json"
,
type:
"POST"
},
Upload: {
url: crudServiceBaseUrl +
"uploadPEP"
,
dataType:
"json"
,
type:
"POST"
},
parameterMap:
function
(options, operation) {
if
(operation !==
"read"
&& options.models) {
return
{models: kendo.stringify(options.models)};
}
}
},
batch:
true
,
pageSize: 10,
schema: {
model: {
id:
"pepid"
,
fields: {
pepid: { editable:
false
, nullable:
true
},
start_date: { type:
"date"
},
comments: { type:
"string"
},
documentsfilenames: { editable:
false
, nullable:
true
},
contributorslist: { type:
"string"
}
}
}
}
});
$(
"#PEPGrid"
).kendoGrid({
dataSource: dataSourcePEP,
pageable:
true
,
height: 150,
toolbar: [
"create"
],
columns: [
{ field:
"start_date"
, title:
"Start Date"
, width:
"140px"
},
{ field:
"comments"
, title:
"Comments"
, width:
"140px"
},
{ field:
"documentsfilenames"
, title:
"Document File Names"
, width:
"140px"
},
{ field:
"contributorslist"
, title:
"Contributors List"
, width:
"100px"
},
{ command: { text:
"Upload"
, click: uploadFile }, title:
" "
, width:
"60px"
},
{ command: [
"edit"
,
"destroy"
], title:
" "
, width:
"110px"
}],
editable:
"popup"
,
create:
true
,
update:
true
,
destroy:
true
});
});
// end ready function
function
uploadFile(e){
console.log(e)
}
Can anyone point me in the right direction? Many thanks in advance for taking the time to look at this.
Tom