Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Vincent Chou on Mar 18, 2009 23:23
open dhtmlx forum
tabbar setContentHTML not able to handle dbl quote character

Dear Sir,

I've an html text including both single quote & dbl quote char on tabbar.setContentHTML as below

<input type='radio' name='additem' onClick="parent.mainFrame.location.href='./some.php' ">


I've already tried put the escape character \ with every dbl quote
but I m not able to put it on tab content

can you give me some help?
Many Thanks!


Vincent
Answer posted by Alex (support) on Mar 19, 2009 05:09

Hello, 

The following code works locally:

tabbar.setContentHTML(tabId,"<input type='radio' name='additem' onClick='parent.mainFrame.document.location.href=\"some.php\" '>");
   

Answer posted by Vincent Chou on Mar 19, 2009 22:29
I notice there are some limitation on using setContentHTML

1) the enclosed html content can only be in one single line
i.e.
tabbar.setContentHTML(tabId,"<table><tr><td>LINE1.0</td><td>LINE1.1</td><td>LINE1.2</td></tr></table>");
This is OK

tabbar.setContentHTML(tabId,"<table>
                                                     <tr><td>LINE1.0</td>
                                                            <td>LINE1.1</td>
                                                            <td>LINE1.2</td>
                                                     </tr></table>");
This is NOT OK

2) Even the enclosed html content in one single line, the code will fail if the line is too long.

I've attached an example for this problem.
the tabbar is OK if you remove the "tabbar.setContentHref("h1","<table class=....."
otherwise you will get a blank tabbar.

Is there any other way to display the complex tabbar content without using tabbar.setHrefMode("ajax-html") mode?

Many thanks!
Vincent


Attachments (1)
Answer posted by Alex (support) on Mar 20, 2009 02:45

Hello, 

Regarding the first problem - it is correct behaviour. As, the following string isn't correct:

"<table>
  <tr><td>LINE1.0</td>
  <td>LINE1.1</td>
  <td>LINE1.2</td>
  </tr></table>"

Just try to do the following:

str = "<table>
  <tr><td>LINE1.0</td>
  <td>LINE1.1</td>
  <td>LINE1.2</td>
  </tr></table>"

alert(str)

You will get the error.

>> the tabbar is OK if you remove the "tabbar.setContentHref("h1","<table class=....."

setContentHref can be used only url. 

If you want to use html string, you should use setContentHTML:

tabbar.setContentHTML("h1","<table class=.....");

Answer posted by Vincent Chou on Mar 20, 2009 10:13
It is my typo mistake.
Thanks Alex!!!!  :)