I am working on breaking down very complex aspx files into smaller more manageable chunks by breaking out duplicated sections of code. So far this has worked out well, however, in some instances, the resulting control requires a window manager. This isn't a problem until more than one control is used that requires a window manager.
However, when including more than one control, a window manager is created for each control. Again, this isn't a huge problem, except that it duplicates javascript functions on the page so that there are multiple functions with the same name and code, for example
function RadWindowprompt_detectenter(id, ev, input)
This isn't my code, but code injected into the resulting html page to handle events for the radwindows.
Is the only solution to place a single windowmanager in the master page and then try and find it in the codebehind and then edit it programmatically to add window templates as needed?
I'd like to remove the duplicates because additional window managers simply add more overhead to the page.
I'll entertain any ideas to make it more efficient.
function
OnClientClicking(sender, args) {
if
(somecondition ==
false
) {
args.set_cancel(
true
);
}
}
args.set_cancel(
false
);
function
OnClientClicking(sender, args) {
if
(somecondition ==
false
) {
args.set_cancel(
true
);
}
else
{
args.set_cancel(
false
);
}
}
Any ideas what might be causing this weirdness?
CaseID |
CASEDT |
CARDIOLOGY |
CTSCAN |
TESTTotal |
C001 |
2013/06/13 |
$500 |
$100 |
$600 |
C002 |
2013/06/13 |
$500 |
|
$500 |
C003 |
2013/06/14 |
|
$100 |
$100 |
C004 |
2013/06/14 |
$500 |
$100 |
$600 |
Yellow highlighted columns are auto generated.
Please provide suitable solutions for the above mentioned.function v_JobRTS(positiontype) {
var JobRTS = $find("<%=JobRTS.ClientID %>");
var moretab = JobRTS.get_tabs().getTab(1);
var finishtab = JobRTS.get_tabs().getTab(2);
if (positiontype == "0" || positiontype == "1") {
//Here is the section that doesn't work.
moretab.set_visible(true);
finishtab.set_visible(true);
} else if (positiontype == "2") {
moretab.set_visible(false);
finishtab.set_visible(true);
} else {
moretab.set_visible(false);
finishtab.set_visible(false);
}
}
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
CellSpacing
=
"0"
GridLines
=
"None"
AutoGenerateColumns
=
"false"
OnItemCreated
=
"RadGrid1_ItemCreated"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridTemplateColumn
HeaderText
=
"SANDI KETERANGAN"
>
<
ItemTemplate
>
<
telerik:RadTextBox
runat
=
"server"
ID
=
"tbsandi"
Enabled
=
"false"
></
telerik:RadTextBox
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
OnItemCreated
=
"RadGrid1_ItemCreated"
protected
void
RadGrid1_ItemCreated(
object
sender, Telerik.Web.UI.GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
var ditem = (GridDataItem)e.Item;
var tbsansi = (RadTextBox) ditem.FindControl(
"tbsandi"
);
tbsansi.Attributes.Add(
"onclick"
,
"openWin("
+ ditem.ItemIndex +
");"
);
}
}
<script type=
"text/javascript"
>
function
openWin(index) {
//
var
RadGrid1 = $find(
'<%=RadGrid1.ClientID %>'
);
//
var
masterTableView = RadGrid1.get_masterTableView();
//
var
row = masterTableView.get_dataItems()[index];
var
oWnd = radopen(
"SandiKeterangan.aspx"
,
"RadWindow1"
);
}
function
OnClientClose(oWnd, args) {
var
arg = args.get_argument();
var
grid = $find(
"<%=RadGrid1.ClientID %>"
);
var
MasterTable = grid.get_masterTableView();
var
length = MasterTable.get_dataItems().length;
for
(
var
i = 0; i < length; i++) {
var
RadTextBoxSandi = MasterTable.get_dataItems()[i].findElement(
"tbsandi"
);
//access the TextBox control
RadTextBoxSandi.innerText = arg.Kode;
// assigning value to TextBox control
}
}
</script>