Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.
My JavaScript abilities are rudimentary at best.
In the attached code, I need an else statement for the following section so that if "mymessage" is not equal to "LT" and/or arrValues is NOT IN the array...a "Invalid Selection" message is returned.
if (mymessage == "LT" && (arrValues.contains(afsSou
args.set_cancel(!confirm("
selectedRows.clear;
function OnClientItemClickingCollapse(sender, args) {
var item = args.get_item();
var grdAFS = $find("<%=grdAvailableForSale.ClientID %>");
var MasterTable = grdAFS.get_masterTableView();
var selectedRows = MasterTable.get_selectedItems();
if (item.get_text() == "Collapse") {
if (selectedRows.length == 1) {
alert("Only 1 Row Selected!");
}
else {
args.set_cancel(!confirm("Are you sure you want to collapse these items?"));
selectedRows.clear;
}
}
else if (item.get_text() == "SplitTaxes") {
vdataItemIndex = $find("<%=grdAvailableForSale.MasterTableView.ClientID%>").get_selectedItems()[0];
var afsid = vdataItemIndex.get_cell("afsid").innerHTML;
var afsSource = vdataItemIndex.get_cell("afsSource").innerHTML;
var afsSourceDetail = vdataItemIndex.get_cell("afsSourceDetail").innerHTML;
var mymessage = afsSource.substring(0, 2)
//arrValues = ["ALL", "P01", "P02", "P03", "P04", "P05"]
// if (mymessage == "LT") {
// args.set_cancel(!confirm("Are you sure you want to split taxes? afsSource: " + afsSource + " afsid: " + afsid));
// }
arrValues = ["ALL", "P01", "P02", "P03", "P04", "P05"]
if (mymessage == "LT" && (arrValues.contains(afsSourceDetail))) {
args.set_cancel(!confirm("Are you sure you want to split taxes? afsSource: " + afsSource + " afsid: " + afsid));
selectedRows.clear;
}
}
}
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.
Posted on 2011-05-10 at 04:52:52ID: 36812555
All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.