|
Gee, this is real professional. A gmail email address, and advertising through online message boards. Not a chance in hell.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I need some help with IE Control Treeview,
I am making this treeview for selecting inputs
for an online application for eg the structure will be like this:
The following sample if we check the Men's Wear check box, all the
following child nodes must get selected and if it is unchecked all
the child node must be unchecked.
---------------------
[]Men's Wear
---[]Shirt
---[]pants
---[]Caps
[]Ladies
---[]T-Shirts
---[]Salwars
[]Kids
---[]Shoes
---[]T-shirts
----------------------
I tried to do this with IE Treeview control but have no idea as to how
to enable the checkboxes from the client side.I can do it with vbcode
but is it works with that then there is a post back is there anyway
I can do this with javascript.
Please help
-- modified at 1:38 Wednesday 26th October, 2005
|
|
|
|
|
Hi there,
In this case, you'll have to edit the treeview htc component defined in the treeview.htc file. You can open the file and go to the checkboxClick method which is the event handler for the click event of the treenode's checkbox. And you will provide a snippet of script to recursively check/uncheck all the checkbox elements of the child nodes. Another way that you might try is to create an event handler for the oncheck event of the treeview control, then recursively check/uncheck the child nodes.
|
|
|
|
|
Well thank you very much for your help.But i already tried that.and wrote 7 function to enable and disable the tree check boxes and to set the queueEvent to each of the checkboxes.the thing is that while i am at it this code is cheking all the checkboxes and not the ones i want.
function start(tree){
checkCheckBox(tree);
TreeView_ReadyForPostback(tree);
}
function TreeView_ReadyForPostback(objTreeView){
//alert("treeview_resdy 0")
if(objTreeView != null)
{
// alert("treeview_resdy 1");
TreeView_CheckVals(objTreeView, objTreeView.getChildren());
}
else
alert("ERROR: TreeView object is null");
}
function TreeView_CheckVals(objTreeView, arrChildren){
//
var objChild;
for(var i = 0; i < arrChildren.length; i++){
objChild = arrChildren[i];
if(TreeView_IsChecked(objChild) != TreeView_GetInitCheckValue(objChild))
objTreeView.queueEvent("oncheck", objChild.getNodeIndex());
//alert("TreeView_CheckVals 1");
TreeView_CheckVals(objTreeView, objChild.getChildren());
}
}
function TreeView_IsChecked(objNode){
//alert("TreeView_CheckVals 1");
if(objNode.getAttribute("Checked"))
return true;
else
return false;
}
function TreeView_GetInitCheckValue(objNode){
alert("iitval");
return objNode.getAttribute("InitCheckValue");
}
function checkCheckBox(c)
{ //TreeView_ReadyForPostback(c);
var tst = c;
var nodeIndex = c.clickedNodeIndex;
var node = c.getTreeNode(c.clickedNodeIndex);
var bChecked = node.getAttribute("checked");
if (c.clickedNodeIndex != null)
{
checkChild(node, bChecked, nodeIndex) ;
node.setAttribute("DEFAULTSTYLE","color:black");
}
}
function checkChild(node, bCheck, nodeIndex)
{ node.setAttribute("DEFAULTSTYLE","color:black");
var ar = node.getChildren();
var i;
var bChecked = node.getAttribute("checked");
var parent;
var el;
if(ar.length > 0)
{
for(i = 0; i < ar.length; i++)
{ ar[i].setAttribute("checked", bChecked, 0);
checkChild(ar[i], bCheck) ;
}
}
else
{
if(bCheck == false)
{
parent = node.getParent();
parent.setAttribute("DEFAULTSTYLE","color:gray");
}
}
}
|
|
|
|
|
+ First of all, you need to define a method to change status of the checkbox of all children, and basically this method is called recursively:
function doChildrenCheckboxClick(parentNode)
{
var col = parentNode.children.tags("treenode");
for (var i = 0; i < col.length; i++)
{
doChildCheckboxClick(col[i]);
if(col[i].children.tags("treenode").length>0)
{
doChildrenCheckboxClick(col[i]);
}
}
}
function doChildCheckboxClick(childNode)
{
childNode.Checked = childNode.checked = childNode.parentElement.Checked;
var evt = createEventObject();
evt.treeNodeIndex = getNodeIndex(childNode);
g_nodeClicked = childNode;
if(childNode.subtree){
var cb = childNode.subtree.all.item("_cb", 0);
cb.setAttribute("checked", childNode.Checked, 0);
}
} + In the event handler checkboxClick , you can simply call the doChildrenCheckboxClick method:
function checkboxClick()
{
...
doCheckboxClick(el);
doChildrenCheckboxClick(el);
fireQueuedEvents();
} + Also, in the doCheckboxClick method, you should update the code a bit:
...
el.Checked = el.checked = !el.Checked;
.... + There is one thing remained though, the status of the checkbox will not be persisted at the server side, so as I comment in the doChildCheckboxClick method, you need to define a custom event in the .htc file like the oncheck , onexpand ... Then you should fire this custom event to notify about this status change of the treenode's checkbox. In the source code of the TreeNode class, you need to provide a snippet of code to process this custom event. For more information, you can have a look at the implementation of other events, and do the same.
|
|
|
|
|
Thanks for you help again.I actually need fire a custom event as to set the checkbox to be checked so is iy ok is i call some thing like queueEvent and set it.But i tried to do this and mt requirements are that i donot modify the hct file.
I could not fixup the problem till now so i am looking for more solutions.
Once again thanks
r@j
|
|
|
|
|
Hi I am having HTML Image (or) ASP:Button inside a Datalist control in ItemTemplate. Whenever I click the control, the page is posting back. There are no server side or javascript coding for this.
|
|
|
|
|
Hi there,
To respond to the Click event of the button controls including Button, ImageButton, and LinkButton placed inside the datalist control, you can create event handler for the ItemCommand event of the datalist control and put your sample code in there. The reason you don't need to create an event handler for the Click event since this event is bubbled up to the ItemCommand event of the parent datalist control. For the html elements, you can create an event handler for the client side event or the server side event, that depends on what you need. For more information, you can see Responding to Button Events in DataList, Repeater, or DataGrid Items[^]
|
|
|
|
|
How do I specify the application root in CSS syntax? (Similar to the functionality of "~" in ASP.NET)
Or is there a way I can insert it dynamically from server code, such as:
background-image: url( <% some server code or variable here %> )
Would the syntax above work? Thanks.
|
|
|
|
|
Anonymous wrote: background-image: url( <% some server code or variable here %> )
Would the syntax above work? Thanks.
Depends.
If you have that code in an aspx page then it will work, but if you have it in your css file then it won't as it will not be processed.
You can either:
1. Use absolute path of for your image (e.g. /images/bg.gif or http://website/images/bg.gif )
The first / before the folder name defines the root path to your URL, you can follow it up with directory name or file name.
2. Use Response.Write or <% %> to create your dynamic CSS within your ASPX page.
There are probably other ways such as creating a .css file from your ASPX code and include it dynamically and such.
Does that help?
Edbert P.
Sydney, Australia
|
|
|
|
|
I don't think there is a way to get the application root since that is derived from asp.net. You can, however, use the css file as the root. So if your file is dirq.net/parthOffRoot/image.png and your css file is dirq.net/css/style.css you can use the url keyword:
url(../pathOffRoot/image.png);
Like:
ul{
list-style-image: url(../structure/sel_box.gif);
}
Dirk Watkins
|
|
|
|
|
Dear All;
I am using IE's API as part of my project. I am loading web pages into a dialog window. Now i am trying to draw a box around each html element. I have successufully done that.
My problem is that these boxes disappear if the mouse is moved over the web page or if the presumed web page contains animation. Can someone tell me how to get rid of this problem ??? i.e how to keep the html elements boxed !!
Cheers
Adam
llp00na
llp00na
|
|
|
|
|
Hi,
My webserver (IIS 5) keeps logging internal server errors (500) on a CSS file. This behaviour is irregular, 50% of the requests are successful. The website itself seems to run without problems. Until now I haven't been able to find any information on this subject (Google).
When I view the stylesheet in Visual Studio, it underlines the next statements as errors, although they do work in Internet Explorer. Microsoft probably won't officially support these statements:
scrollbar-face-color: #ffffff;<br />
scrollbar-highlight-color: #A6A6A6;<br />
scrollbar-3dlight-color: #ffffff;<br />
scrollbar-darkshadow-color: #ffffff;<br />
scrollbar-shadow-color: #666666;<br />
scrollbar-arrow-color: #009900;<br />
scrollbar-track-color: #ffffff;
I haven't found out yet if this is the cause of the problem. It seems strange that a webserver would parse a CSS file, and even stranger to report server errors on it.
I'd be thankful for a solution to this puzzle, and clean up the webserver logs.
|
|
|
|
|
Help,
I seem to have forgotten the code to write data from a page to SQL. I use C#
The code is as follows:
SqlCommand RegisterCMD = new SqlCommand("RegisterUser", Conn);
RegisterCMD.CommandType = CommandType.StoredProcedure;
RegisterCMD.Parameters.Add(new SqlParameter("@FirstName", SqlDbType.VarChar, 25));
RegisterCMD.Parameters(FirstName.Text);
The last line I need some help....
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
Well it depends on what your stored proc does -
if it does an insert/update call registerCMD.ExecuteNonQuery();
If it return something you can either call registerCMD.ExecuteReader(); or use a SqlDataApabter
|
|
|
|
|
I'm not sure about cookies. I'm not even sure is this is a programming question! But help'd be appreciated!
I know there must be a script that can be run on an apache server which will allow my visitors, once successfully logged in, to stay logged in until they log out! I'm having problems...
Anyway, thanks in advance all you random strangers!
Smallishfry@hotmail.co.uk
E-mail me if your willing to pay for a professional we-page at the fraction of a cost.
-- modified at 11:14 Tuesday 25th October, 2005
|
|
|
|
|
Smallishfry wrote: E-mail me if your willing to pay for a professional we-page at the fraction of a cost.
A we-page ? What's that ? ( I assume 'web page' - will the cheap page be full of typos as well ? )
Yes, this is a programming question - try on the web development forum, but even then, I'd expect the people here using Apache would be limited.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: A we-page ? What's that ? ( I assume 'web page' - will the cheap page be full of typos as well ? )
Ah come on, it’s so much easier to let him make the spelling errors for me. That way I know for sure its all screwed up.
All that and its cheap.
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
I don't know about apache, but can't you implement this using cookies or sessions?
|
|
|
|
|
Yeah... Cookies are tasty but they frazzler my brain! Can any-one give me an exact script???
Smallishfry@hotmail.co.uk
|
|
|
|
|
Here's your script.
http://www.google.com
type in "website cookie script login" exactly as it appears.
click search
the second result that appears... click it.
If you registered with a real email address I sent you a direct link. Otherwise you'll have to follow the the hints.
Now take this answer and go post it in whatever other forum here you asked in as that's the right place for it... I'm not going to do *all* your work for you.;P
Some assembly required.
Code-frog System Architects, Inc.
-- modified at 3:08 Tuesday 25th October, 2005
|
|
|
|
|
Smallishfry wrote: E-mail me if your willing to pay for a professional we-page at the fraction of a cost.
Try to not advertise your services as cheap and, at the same time, make a very basic programming question...
I see dead pixels
Yes, even I am blogging now!
-- modified at 3:42 Tuesday 25th October, 2005
|
|
|
|
|
Daniel Turini wrote: Try to not advertise your services as cheap and, at the same time, make a very basic programming question...
But considering he's only 11 years old, I admire his gut and will cut some slack on him not knowing the proper way to advertise himself yet.
Signature
The only valid use of the BLINK tag: Schrodinger's cat is <blink>not dead .
|
|
|
|
|
I didn't read his profile
|
|
|
|
|
Cookies^
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|