Hi,
I'm not sure where else to submit this so I figure I'd place it here.
There appears to be a minor omission in the JavaScript for the GridAttachmentColumn online example. Visit the example here.
Examine the conditionalPostback function:
Draw your attention to the variable named theRegexp which appears to be a Regular Expression container. The variable is defined, but it is never used. I suspect that it was supposed to have been used in the If block that follows, like this:
...such that the final block actually reads like this:
While the code that was there before would work too, it can prove to be a little confusing for people who aren't terribly familiar with JavaScript who would include that variable definition for no good reason.
Cheers,
John
I'm not sure where else to submit this so I figure I'd place it here.
There appears to be a minor omission in the JavaScript for the GridAttachmentColumn online example. Visit the example here.
Examine the conditionalPostback function:
function
conditionalPostback(sender, eventArgs)
{
//The variable 'theRegexp' is never used
var
theRegexp =
new
RegExp(
"\.UpdateButton$|\.PerformInsertButton$"
,
"ig"
);
var
eventArgument = eventArgs.get_eventArgument();
if
(eventArgument.indexOf(
"Update"
) > -1 || eventArgument.indexOf(
"PerformInsert"
) > -1)
{
if
(upload && upload.getFileInputs()[0].value !=
""
)
{
eventArgs.set_enableAjax(
false
);
}
}
}
Draw your attention to the variable named theRegexp which appears to be a Regular Expression container. The variable is defined, but it is never used. I suspect that it was supposed to have been used in the If block that follows, like this:
if
(eventArgs.get_eventTarget().match(theRegexp)){
//Disable AJAX functionality
}
...such that the final block actually reads like this:
function
conditionalPostback(sender, eventArgs)
{
//This is the corrected version
var
theRegexp =
new
RegExp(
"\.UpdateButton$|\.PerformInsertButton$"
,
"ig"
);
var
eventArgument = eventArgs.get_eventArgument(); //this variable may not be needed either
if
(
eventArgument.match(theRegexp)) //or eventArgs.get_eventTarget().match(theRegexp)
{
if
(upload && upload.getFileInputs()[0].value !=
""
)
{
eventArgs.set_enableAjax(
false
);
}
}
}
While the code that was there before would work too, it can prove to be a little confusing for people who aren't terribly familiar with JavaScript who would include that variable definition for no good reason.
Cheers,
John