 |
|
 |
Allow itens without link (blank)
Change
------------------------ Original code ----------------------------
function GenerateSubContent(ContentText, CurNode)
{
var ArrItemDesc = Item[CurNode][1].split(";");
var ArrItemHref = Item[CurNode][2].split(";");
var ArrItemTarget = Item[CurNode][3].split(";");
for(var i=1; i<ItemTab.length; i++) {
DocWrite("<td><a href='" + ArrItemHref[i] + "' target='" + ArrItemTarget[i] + "'>" + ArrItemDesc[i] + "</a></td>");
}
}
------------------------ Original code ----------------------------
to:
------------------------ My change ----------------------------
function GenerateSubContent(ContentText, CurNode)
{
var ArrItemDesc = Item[CurNode][1].split(";");
var ArrItemHref = Item[CurNode][2].split(";");
var ArrItemTarget = Item[CurNode][3].split(";");
for(var i=1; i<ItemTab.length; i++) {
if ( ArrItemHref[i] == '' ) {
DocWrite("<td><a href='" + ArrItemHref[i] + "' target='" + ArrItemTarget[i] + "'>" + ArrItemDesc[i] + "</a></td>");
} else {
DocWrite("<td>" + ArrItemDesc[i] + "</td>");
}
}
}
------------------------ My change ----------------------------
by
Master_Zion (Brazil)
|
|
|
|
 |
|
|
 |
|
 |
I am chinese guy who live in HongKong, so forgive my bad english.
2 years ago, i start to create a NNTP(Usenet) application by ASP.NET,
and i need to bind the article from TCP Stream to treelist / treegrid (just like the outlook express inbox)
i search all around yahoo & google, i cannot find any Free & open-source DHTML or ASP.NET control to
work ,so i build my own with asp.net datagrid & repeater control. But unfortunately it make me hard to
development.so i give up this project.
Today, i pick up this project again, and i wonder is it any free treegrid stuff have been release in
this 2 years, finally, i found your one!
It's simple code but reliable, it's good for create dyncmic hyperlink from database, that's is what
i seeking in this 2 years.
so i can build my own nntp application again.
You did a great Job!!! I believe it many developer need your TreeGrid!!
|
|
|
|
 |
|
 |
Thank you for providing this. I was looking for something exactly like this and couldnt find anything. I thought I was going to have to create something from scratch. THen I found yours and was so happy! You saved me so many hours of work!!! THANKS!!!!!!!
|
|
|
|
 |
|
 |
same here !!;) :-Ocheer ~~~~~~ ;)
|
|
|
|
 |
|
 |
Hello, First thanks for the wonderful code. but i noticed a small bug in the code which would prevent it from displaying more than 2 columns. ---------------Original code---------------------------------- function GenerateSubContent(ContentText, CurNode) { for(var i=0; i<ItemTab.length-1; i++) { var ArrItemDesc = Item[CurNode][1].split(";"); var ArrItemHref = Item[CurNode][2].split(";"); var ArrItemTarget = Item[i][3].split(";"); for(var j=1; j<ArrItemDesc.length-1; j++) { DocWrite("<td><a href='" + ArrItemHref[j] + "' target='" + ArrItemTarget[j] + "'>" + ArrItemDesc[j] + "</a></td>"); } } } ---------------Original code---------------------------------- ---------------Modified code---------------------------------- function GenerateSubContent(ContentText, CurNode) { var ArrItemDesc = Item[CurNode][1].split(";"); var ArrItemHref = Item[CurNode][2].split(";"); var ArrItemTarget = Item[CurNode][3].split(";"); for(var i=1; i<ItemTab.length; i++) { DocWrite("<td><a href='" + ArrItemHref[i] + "' target='" + ArrItemTarget[i] + "'>" + ArrItemDesc[i] + "</a></td>"); } } ---------------Modified code---------------------------------- Hope this helps some one thanks Opensource
|
|
|
|
 |
|
 |
THANK YOU for this bug fix. It was extremely helpful!
|
|
|
|
 |
|
 |
Thanks for the fix... It was really helpful... I spent almost an hour trying to figure out why it generates 2 extra columns... then i decided to see the forum and found this... thanks
|
|
|
|
 |
|
 |
Hi there, I really appreciate this effort. But I have a very specific need. It would be nice if you could direct me a bit. I require that the rows in the tree grid are created dynamically. Actually, the complete row and column details, including child details are fetched through AJAX in JSON format which is converted to an array at client side. Then I use a recursive loop to create rows according to the array. I am using recursion because the number of child levels is not known. I need 5 columns. But when I do this in ur script it repeats the last 4 columns 3 times. I am not able to get the child rows to appear as well. I am unable to find the prob. This is the code I am using <code> function getJSON(url) { var XHRObj = false; try { // For Internet Explorer. XHRObj = new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) { try { // Gecko-based browsers, Safari, and Opera. XHRObj = new XMLHttpRequest(); } catch (e) { // Browser supports Javascript but not XMLHttpRequest. XHRObj = false; } } if(XHRObj) { XHRObj.open("GET", url, false); XHRObj.send(null); strJSON = XHRObj.responseText; return strJSON; } } function build_treegrid(tg, tg_arr, parent) { if (typeof parent == "undefined") parent = null; for (var i = 0; i < tg_arr.length; i++) { var str_RowText = ""; var str_links = ""; var str_target = ""; if (tg_arr[i]["cells"]) { for (var x = 0; x < tg_arr[i]["cells"].length; x++) { str_RowText += tg_arr[i]["cells"][x]["text"] + ";"; str_links += ";"; str_links += "_self;"; } } var thisId = tg.InsItem(parent, str_RowText, str_links, str_target); if (tg_arr[i]["children"]) { build_treegrid(tg, tg_arr[i]["children"], thisId); } } } // Create wsGrid Instance var tg = new wsGridCtrl(); // Param1: width // Param2: OnMouseOver Color tg.initializeDocument(500, "#FFeeee"); // Titles // Param1: Text // Param2: Width tg.InsTab("View Name", "*"); tg.InsTab("Modified On", "100"); tg.InsTab("Modified By", "100"); tg.InsTab("Filter Description", "100"); tg.InsTab("Image", "100");
tg_str = getJSON("treegridjson.php"); var tg_array = tg_str.parseJSON(); build_treegrid(tg, tg_array); tg.GenerateCode(); tg.RecudeAllTree(); </code> Thanx in advance
|
|
|
|
 |
|
 |
Thanks so much for posting this; the theory behind it makes a lot of people's like easier!
One quesiton: When i use the script, I am trying to add 8 colums x 4 rows, but it doesn't create new rows; everything is on the one row... any idea why?
Thanks in advance,
Tim
|
|
|
|
 |
|
 |
Hi,
Its possible include a dynamic item, without refresh the browser ?
Thanks
Leandro
|
|
|
|
 |
|
 |
I like this control ... it appears to run rather smoothly and to be cross-browser compatible.
One question and one suggestion:
Question - why are you using buttons for the title bar area?
Suggestion - use classes for the different elements of the Grid Control so people could build their own style for it using CSS instead of modifying the JS file.
Wally Atkins Newport News, VA, USA
|
|
|
|
 |
|
 |
Thank you for having interest.
Reason that use button for title area is that tried to sorting function in next version.
And contents that suggestion will try to embody in next versino.
Thank you.
Jongha Ahn.
KOREA
Ahn@jongha.pe.kr
http://whitespray.com
|
|
|
|
 |