All other mechanics are in place, we just need to know how to access the edit value, we are capturing the command events by:
<ClientEvents OnCommand="RaiseCommand"/>
And we need to get our edited values from/in our client side script .... we already have access to previous values (data values) but do not seem to be able to get the edited values
here is the latest of the test code to try to get this to work ...
function RaiseCommand(sender, args)
{
//retrieve the current commandName and commandArgument
var result = String.format("CommandName: {0}, CommandArgument: {1}", args.get_commandName(), args.get_commandArgument());
if(args.get_commandName() == "Update"){
var grid = sender;
var MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems()[args.get_commandArgument()];
var cell = MasterTable.getCellByColumnUniqueName(row, "EndDate");
var dtStart = new Date("<%=ViewState("StartDate").ToString %>");
var dtCompare = new Date();
var popUp = args.get_popUp();
var pArgs = popUp.arguments;
alert(pArgs.EndDate);
if(cell.innerHTML == "" || cell.innerHTML == " "){
dtCompare =
"01/01/1800";
else{
dtCompare = cell.innerHTML;
}
alert(dtStart);
alert(dtCompare);
var newValues=MasterTable.extractValuesFromItem(args.get_commandArgument());
var newValuesSB = new Sys.StringBuilder();
for(var property in newValues)
{
newValuesSB.append(String.format(
"<b>{0}</b> : {1} <br/>", property,newValues[property]));
}
alert(newValuesSB);
if(dtCompare < dtStart){
// confirm
if(!confirm("Setting the End Date as you have will result in this disclosure falling outside of the Annual Review Period. Do you wish to proceed?")) {
args.set_cancel(
true);
}
}
//alert(result);
}
}
Many many thanks in advance!