Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-05-2009, 08:46 AM   PM User | #1
amr_cis
New to the CF scene

 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
amr_cis is an unknown quantity at this point
Dom Appending Control

Dear,
I am using control ntb combo
the control to use

-Namespace <html xmlns:ntb>
-javaScript files

Control Render in browser Like this

<ntb:Combo TABINDEX=0 id="H_Unit_22_0_" InitialSearch="zzz__is__1000002" Mode="classic" >
<ntb:ComboTextBox width=245px OnEditKeyUpEvent="ifEmptyRepopulate(this)" DataFieldIndex=1></ntb:ComboTextBox>
<ntb:ComboList OnHideEvent="TextboxSetSelection('H_Unit_22_0_');" OnAfterSearchEvent="TextboxSetInitialValue('H_Unit_22_0_');" height=200 width=748px
DatasourceUrl="b6fm/getData.asp?tr=47&viewid=0&req=0" PageSize="50" >
<ntb:ComboColumnDefinition width=120px HeaderLabel="Caption" DataFieldIndex=1>
</ntb:ComboColumnDefinition>
<ntb:ComboColumnDefinition width=120px HeaderLabel="Id" DataFieldIndex=0>
</ntb:ComboColumnDefinition></ntb:ComboList></ntb:Combo>

I want to create this control Dyanmicly
I am create <td> and added it in table I dont problem in this I
Tired
txt = '<ntb:Combo TABINDEX=4 id="' + comboName + '" Mode="classic" theme="outlook" >';
txt = txt + '<ntb:ComboTextBox width=245px OnEditKeyUpEvent="ifEmptyRepopulate(this)" DataFieldIndex=1></ntb:ComboTextBox>'
txt = txt + '<ntb:ComboList OnHideEvent="TextboxSetSelection(' + sq + comboName + sq + ');" height=200 width=766px DatasourceUrl="b6fm/getData.asp?tr=51" PageSize="50">';
txt = txt + '<ntb:ComboColumnDefinition width=240px HeaderLabel="Display Name" DataFieldIndex=1>';
txt = txt + '</ntb:ComboColumnDefinition><ntb:ComboColumnDefinition width=180px HeaderLabel="First Name" DataFieldIndex=2>';
txt = txt + '</ntb:ComboColumnDefinition><ntb:ComboColumnDefinition width=180px HeaderLabel="Last Name" DataFieldIndex=3>';
txt= txt + '</ntb:ComboColumnDefinition><ntb:ComboColumnDefinition width=132px HeaderLabel="User Id" DataFieldIndex=0>';
txt = txt + '</ntb:ComboColumnDefinition></ntb:ComboList></ntb:Combo>';

tdNode.innerHTML=txt; /// I dont have problem in tdNode

also tired
working in attribute will not make Differance
var comboNode = document.createElement('ntb:Combo');
var comboText= document.createElement('ntb:ComboTextBox');
var comboList=document.createElement('ntb:ComboList');
var comboColumn=document.createElement('ntb:ComboColumnDefinition');
var comboColumn2=document.createElement('ntb:ComboColumnDefinition');


comboNode.id="'" + comboName + "'";
comboNode.Mode="'classic'";

comboText.OnEditKeyUpEvent="ifEmptyRepopulate(this)";
comboText.DataFieldIndex="1";
comboText.width="245px";
comboList.OnHideEvent="TextboxSetSelection('" + sq + comboName + sq + '); ' ;
comboList.height=200;
comboList.width='766px';
comboList.DatasourceUrl="b6fm/getData.asp?tr=99";
comboList.PageSize="50";
comboColumn.width="240px";
comboColumn.DataFieldIndex=1;
comboColumn.HeaderLabel="Display Name";
comboColumn2.width="240px";
comboColumn2.DataFieldIndex=0;
comboColumn2.HeaderLabel="User Id";
comboList.appendChild(comboColumn);
comboList.appendChild(comboColumn2);
comboNode.appendChild(comboText);
comboNode.appendChild(comboList);

tdNode.appendChild(comboNode);

also tired
var comboNode = document.createElementNS("ntb",'ntb:Combo');

var comboText= document.createElementNS("ntb",'ntb:ComboTextBox');
var comboList=document.createElementNS("ntb",'ntb:ComboList');
var comboColumn=document.createElementNS("ntb",'ntb:ComboColumnDefinition');
var comboColumn2=document.createElementNS("ntb",'ntb:ComboColumnDefinition');

same....

When I tring
to get the value innerhtml of td :: document.getElementById ("td"+combArr[i]).innerHTML // combArr[i] name...no prblem here
give me correctly the tags ::--
this alert
---------------------------
Windows Internet Explorer
---------------------------
|td| <?xml:namespace prefix = ntb /><ntb:Combo id="'vComboTest'" Mode="'classic'"><ntb:ComboTextBox width="245px" DataFieldIndex="1" OnEditKeyUpEvent="ifEmptyRepopulate(this)"></ntb:ComboTextBox><ntb:ComboList PageSize="50" DatasourceUrl="b6fm/getData.asp?tr=99" height="200" OnHideEvent="TextboxSetSelection(''vComboTest'); "><ntb:ComboColumnDefinition DataFieldIndex="1" HeaderLabel="Display Name"></ntb:ComboColumnDefinition><ntb:ComboColumnDefinition DataFieldIndex="0" HeaderLabel="User Id"></ntb:ComboColumnDefinition></ntb:ComboList></ntb:Combo>
---------------------------
OK
---------------------------



but if i get last ntb Combo will display
alert ("|combo|" +document.getElementsByTagName("Combo")[ document.getElementsByTagName("Combo").length -1 ].innerHTML);
the first tag
<ntb:Combo TABINDEX=4 id="' + comboName + '" Mode="classic" theme="outlook" >';
is missed up

the alert like this
---------------------------
Windows Internet Explorer
---------------------------
|combo|<?xml:namespace prefix = ntb /><ntb:ComboTextBox width="245px" DataFieldIndex="1" OnEditKeyUpEvent="ifEmptyRepopulate(this)"></ntb:ComboTextBox><ntb:ComboList PageSize="50" DatasourceUrl="b6fm/getData.asp?tr=99" height="200" OnHideEvent="TextboxSetSelection(''vComboTest'); "><ntb:ComboColumnDefinition DataFieldIndex="1" HeaderLabel="Display Name"></ntb:ComboColumnDefinition><ntb:ComboColumnDefinition DataFieldIndex="0" HeaderLabel="User Id"></ntb:ComboColumnDefinition></ntb:ComboList>
---------------------------
OK
---------------------------

Aslo tired to create Object from this control like this

var tempCombo = nitobi.getComponent(comboName);
tempCombo.SetId('_newID_');

tdNode.appendChild(tempCombo);

Error Message no such interface supported
Tired to register dll files .....

I am confused how can be solved that
I am using IE7
regards
amr_cis is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:05 PM.


Advertisement
Log in to turn off these ads.