Michael

Here is the javascript that i used. basically when people click on
category, it shows the subcategory, on the subcategory callback, it
also loads the content of that category

addNamespace("MyAjax");
MyAjax.Page = Class.create();
MyAjax.Page.prototype = (new AjaxPro.Request()).extend({
        GetMyClass: function(callback) {

                return this.invoke("GetMyClass", {}, callback);
        },
        initialize: function() {
                this.url =
"/esolution/ajaxpro/MyAjax.Page,MyAjax.ashx";
        }

})


function ShowSubCategory(CategoryID,LabelID){
window.setTimeout('', 1);
//alert(document.getElementById(LabelID).style.visibility)
if (document.getElementById(LabelID).style.visibility=="hidden"){
    document.getElementById(LabelID).style.visibility="visible";
    Page.LoadSubCategory(CategoryID,LabelID,CallBackSubCategory);
    //Add CategoryID to the search Hidden Field
    try{
    //AddCategoryID(CategoryID)
    }
    catch(e){
    }
    }
else
    {
    ShowContent(CategoryID,0,1);
    document.getElementById(LabelID).style.visibility="hidden"
    document.getElementById(LabelID).innerHTML=""
    }
}

function CallBackSubCategory(res){
    //alert(res.value.Tables[0].Rows.length);
    //alert(res.value.Tables[0].Rows[0].CategoryID)
try {
   var lbid = res.value.Tables[1].Rows[0].LabelID; //table1 labelid
    //table2 categoryid
//   if (document.getElementById(lbid).innerHTML=="")
//   {
        var ReturnHTML = "<table width=165 cellpadding=0
cellspacing=0>"
            for(i=0; i < res.value.Tables[0].Rows.length; i++)
            {
                var Data = res.value.Tables[0].Rows[i]
                ReturnHTML += "<tr id="+ lbid + i +"><td>&nbsp;&nbsp;"
                ReturnHTML += "<img src=images/subfile.gif border=0>&nbsp;<a
href=javascript:ShowContent("+ Data.CategoryID +","+ Data.SubCategoryID
+",1);HighlightClickedRow('" + lbid + i + "','#FFFFFF');
class=left_text>"
                ReturnHTML +=  Data.SubCategoryName +"</a></td></tr>"
            }
            ReturnHTML += "</table>"
            //alert(ReturnHTML);
        document.getElementById(lbid).innerHTML = ReturnHTML;


ShowContent(res.value.Tables[2].Rows[0].CategoryID,0,1);

    //window.setTimeout('ShowContent(' +
res.value.Tables[2].Rows[0].CategoryID + ',0,1);', 1);
}
catch(e)
{

}
//     else
//     {
//         document.getElementById(lbid).style.visibility="hidden";
//         document.getElementById(lbid).innerHTML=""
//     }
}

function ShowContent(CategoryID,SubCategoryID,PageNumber){
    window.setTimeout('', 1);
    //Add Subcategory ID to the search hidden field
    //AddSubCategoryID(SubCategoryID);

MyAjax.LoadContent = new MyAjax.Page();
MyAjax.LoadContent(CategoryID,SubCategoryID,PageNumber,CallBackLoadContent)

   //
Page.LoadContent(CategoryID,SubCategoryID,PageNumber,CallBackLoadContent)
}

function CallBackLoadContent(f){
<<Load content codes>>

}


thanks again michael


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to