using …

Pure C#

Temmuz, 2009 için Arşiv

Notes on the comp.lang.javascript FAQ

Yazan: esersahin 30/07/2009

http://www.jibbering.com/faq/faq_notes/faq_notes.html#toc

Table of Contents

Introduction to the Notes

Because the comp.lang.javascript FAQ is posted to the group regularly there are practical constraints on how much can be included in it. At the same time it is often felt that it should contain more (or more in-depth) information on some of its topics. The FAQ is largely designed to provide URLs of other resources that provide that additional information, but where no additional resource is available or it is felt that those resources omit important information. These notes are intended to provide an opportunity for those additional resources to be created.

It is intended that anyone who wishes to contribute notes should be able to do so (under editorial control) and that some of the more in-depth postings to the group should become notes, or be incorporated within them.

Yazı kategorisi: JavaScript | » yorum bırak;

Javascript Type-Conversion

Yazan: esersahin 30/07/2009

http://www.jibbering.com/faq/faq_notes/type_convert.html

Yazı kategorisi: JavaScript | » yorum bırak;

JavaScript Function Reference

Yazan: esersahin 30/07/2009

http://www.w3schools.com/jsref/jsref_obj_global.asp

JavaScript Function Reference


The top-level properties and functions can be used on all of the built-in JavaScript objects.


Top-level Functions

FF: Firefox, IE: Internet Explorer

Function Description FF IE
decodeURI() Decodes an encoded URI 1 5.5
decodeURIComponent() Decodes an encoded URI component 1 5.5
encodeURI() Encodes a string as a URI 1 5.5
encodeURIComponent() Encodes a string as a URI component 1 5.5
escape() Encodes a string 1 3
eval() Evaluates a string and executes it as if it was script code 1 3
isFinite() Checks if a value is a finite number 1 4
isNaN() Checks if a value is not a number 1 3
Number() Converts an object’s value to a number 1
parseFloat() Parses a string and returns a floating point number 1 3
parseInt() Parses a string and returns an integer 1 3
String() Converts an object’s value to a string 1
unescape() Decodes a string encoded by escape() 1 3

Top-level Properties

Property Description FF IE
Infinity A numeric value that represents positive or negative infinity 1 4
NaN Indicates that a value is “Not a Number” 1 4
undefined Indicates that a variable has not been assigned a value 1 5.5

Yazı kategorisi: JavaScript | » yorum bırak;

JavaScript DHTML » Form Control

Yazan: esersahin 30/07/2009

http://www.java2s.com/Code/JavaScript/Form-Control/CatalogForm-Control.htm

Form Control
Accept( 4 ) Button( 29 ) CheckBox( 17 ) Focus Tab( 2 ) Form Demo( 6 ) Form Help( 1 )
Form HTML( 20 ) Form Info( 4 ) Form Layout( 1 ) Form Reset( 1 ) Form Submit( 4 ) Form Validation( 12 )
Form( 1 ) Formatted TextField( 1 ) Label( 1 ) List( 5 ) Option Select ComboBox( 48 ) Password( 4 )
RadioButton Radio( 12 ) TextArea( 11 ) TextField( 33 ) Upload Button( 1 ) Validation( 26 )

Yazı kategorisi: DHTML, Form Controls, JavaScript | » yorum bırak;

Embedding ASP.NET Server Variables in Client JavaScript

Yazan: esersahin 30/07/2009

http://www.west-wind.com/WebLog/posts/252178.aspx

Yazı kategorisi: Asp.Net, JavaScript | » yorum bırak;

A Localization Handler to serve ASP.NET Resources to JavaScript

Yazan: esersahin 30/07/2009

http://www.west-wind.com/Weblog/posts/698097.aspx

Yazı kategorisi: JavaScript, Localization, Resource | » yorum bırak;

Add / Remove / Disable Nodes

Yazan: esersahin 29/07/2009

http://demos.mcmscontrols.com/ASPNET/TreeView/Examples/Programming/AddRemoveDisable/DefaultCS.aspx

Yazı kategorisi: Telerik, TreeView | » yorum bırak;

Adding and Editing Templates at Runtime

Yazan: esersahin 29/07/2009

http://www.telerik.com/help/aspnet-ajax/tree_templatesruntime.html

Yazı kategorisi: Telerik, TreeView | » yorum bırak;

Finding Nodes at Runtime

Yazan: esersahin 28/07/2009

http://www.telerik.com/help/aspnet-ajax/tree_nodesfinding.html

To find a Node by Text, Value or Attribute, use the methods FindNodeByText(), FindNodeByValue() and FindNodeByAttribute(). Both RadTreeView and RadTreeView.Nodes has all three methods. In addition, RadTreeView has a FindNodeByUrl() method. For a step by step tutorial on using these find methods see Tutorial: Finding Nodes.

 To use the code examples below, include a reference to Telerik.Web.UI in the “using” (C#) or the “Imports” (VB) section of code.

FindNodeByText()

The example below searches for a Node with a Text property of “Product Categories”.

[C#] FindNodeByText()  
protected void btnFind_Click(object sender, EventArgs e)
{
   RadTreeNode foundNode = RadTreeView1.FindNodeByText(
“Product Categories”);
   
if (foundNode != null)
   {
       tbResults.Text = foundNode.Text;
   }
}
[VB] FindNodeByText()
Protected Sub btnFind_Click(ByVal sender As Object, ByVal e As EventArgs)
 Dim foundNode As RadTreeNode = RadTreeView1.FindNodeByText(“Product Categories”)
 If foundNode IsNot Nothing Then
  tbResults.Text = foundNode.Text
 End If
End Sub

FindNodeByValue()

The example below searches for a Node with a Value property of “1234″.

[C#] FindNodeByValue()
protected void btnFind_Click(object sender, EventArgs e)
{
   RadTreeNode foundNode = RadTreeView1.FindNodeByValue(
“1234″);
   
if (foundNode != null)
   {
       tbResults.Text = foundNode.Text;
   }
}
[VB] FindNodeByValue()
Protected Sub btnFind_Click(ByVal sender As Object, ByVal e As EventArgs)
 Dim foundNode As RadTreeNode = RadTreeView1.FindNodeByValue(“1234″)
 If foundNode IsNot Nothing Then
  tbResults.Text = foundNode.Text
 End If
End Sub

FindNodeByAttribute()

In the example below several Nodes are added to the RadTreeView. The first Node, “root1″ has an attribute added to it. When a button is clicked, the FindNodeByAttribute() method looks for the Node with the identical key and value pair.

[C#] Find NodeByAttribute()
using Telerik.Web.UI;
namespace RadControls_NodesFind
{
   
public partial class _Default : System.Web.UI.Page
   {
       
protected void Page_Load(object sender, EventArgs e)
       {
           
if (!Page.IsPostBack)
           {
               RadTreeNode root1 =
new RadTreeNode(“root1″);
               root1.Attributes.Add(
“My Key”, “My Value”);
               RadTreeView1.Nodes.Add(root1);
               RadTreeNode root2 =
new RadTreeNode(“root2″);
               root2.Nodes.Add(
new RadTreeNode(“child1″));
               root2.Nodes.Add(
new RadTreeNode(“child2″));
               root2.Nodes.Add(
new RadTreeNode(“child3″));
               RadTreeView1.Nodes.Add(root2);
               RadTreeNode root3 =
new RadTreeNode(“root3″);
               RadTreeNode child3 =
new RadTreeNode(“child3″);               
               child3.Nodes.Add(
new RadTreeNode(“child node under child3″));
               root3.Nodes.Add(child3);
               RadTreeView1.Nodes.Add(root3);
           }
       }
       
protected void btnFind_Click(object sender, EventArgs e)
       {
           RadTreeNode foundNode = RadTreeView1.FindNodeByAttribute(
“My Key”, “My Value”);
           
if (foundNode != null)
           {
               tbResults.Text = foundNode.Text;
           }
       }
   }
}
[VB] Find NodeByAttribute()
Imports Telerik.Web.UI
namespace RadControls_NodesFind
 Public Partial Class _Default
  Inherits System.Web.UI.Page
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
   If Not Page.IsPostBack Then
    Dim root1 As New RadTreeNode(“root1″)
    root1.Attributes.Add(“My Key”, “My Value”)
    RadTreeView1.Nodes.Add(root1)
    Dim root2 As New RadTreeNode(“root2″)
    root2.Nodes.Add(New RadTreeNode(“child1″))
    root2.Nodes.Add(New RadTreeNode(“child2″))
    root2.Nodes.Add(New RadTreeNode(“child3″))
    RadTreeView1.Nodes.Add(root2)
    Dim root3 As New RadTreeNode(“root3″)
    Dim child3 As New RadTreeNode(“child3″)
    child3.Nodes.Add(New RadTreeNode(“child node under child3″))
    root3.Nodes.Add(child3)
    RadTreeView1.Nodes.Add(root3)
   End If
  End Sub
  Protected Sub btnFind_Click(ByVal sender As Object, ByVal e As EventArgs)
   Dim foundNode As RadTreeNode = RadTreeView1.FindNodeByAttribute(“My Key”, “My Value”)
   If foundNode IsNot Nothing Then
    tbResults.Text = foundNode.Text
   End If
  End Sub
 End Class
End Namespace

See Also

Yazı kategorisi: TreeView | » yorum bırak;

Getting the Nodes Full Path

Yazan: esersahin 28/07/2009

http://www.telerik.com/help/aspnet-ajax/tree_nodesfullpath.html

To get the full path of a given node, walk the node hierarchy in reverse order using the client-side node object get_parent() method. Notice the statement within the while loop that checks if the currentObject.get_parent() is not null; this statement is only true when currentObject is a node. As the loop climbs back up the tree, eventually currentObject is the RadTreeView client side object and calling get_parent() will return null.

[JavaScript] Traversing the Node Hierarchy in Reverse Order  
var s = node.get_text();
var currentObject = node.get_parent();
while (currentObject != null)
{
 // get_parent() will return null when we reach the treeview
 if (currentObject.get_parent() != null)
 {
   s = currentObject.get_text() + ” > ” + s;
 }
 currentObject = currentObject.get_parent();
}

The following example demonstrates retrieving the full node path. The main logic resides in the OnClientMouseOver event. The arguments passed into the event provide a reference to the currently selected node. The node is traversed in reverse order and a string containing the text path is built up. Finally the text is assigned to the innerHTML of a div for display above the RadTreeView.

 

[ASP.NET]  
<script language=“javascript” type=“text/javascript”>
   
function onMouseOver(sender, args)
   {
       var node = args.get_node();
       var s = node.get_text();
       var currentObject = node.get_parent();
       while (currentObject != null)
       {
         // get_parent() will return null when we reach the treeview
         if (currentObject.get_parent() != null)
         {
           s = currentObject.get_text() + ” > ” + s;
         }
         currentObject = currentObject.get_parent();
       }
       var tbPath;
       tbPath = $get(“pathText”);
       tbPath.innerHTML = s;
   }
   function onMouseOut(sender, args)
   {            
       $get(“pathText”).innerHTML = “”;
   }
</script>
<
form id=“form1″ runat=“server”>
   
<asp:ScriptManager ID=“ScriptManager1″ runat=“server” />
   
<div>
       
<div id=“pathText” class=“RadTreeView_Hay” style=“height: 20px”></div>
       
<telerik:RadTreeView ID=“RadTreeView2″ runat=“server” OnClientMouseOver=“onMouseOver”
           
OnClientMouseOut=“onMouseOut” Skin=“Hay”>
           
<Nodes>
               
<telerik:RadTreeNode runat=“server” Text=“Products” ExpandMode=“ClientSide”>
                   
<Nodes>
                       
<telerik:RadTreeNode runat=“server” Text=“Books” ExpandMode=“ClientSide”>
                           
<Nodes>
                               
<telerik:RadTreeNode runat=“server” Text=“Fiction”></telerik:RadTreeNode>
                               
<telerik:RadTreeNode runat=“server” Text=“Non-Fiction”></telerik:RadTreeNode>
                               
<telerik:RadTreeNode runat=“server” Text=“Biography”></telerik:RadTreeNode>
                               
<telerik:RadTreeNode runat=“server” Text=“Humor”></telerik:RadTreeNode>
                           
</Nodes>
                       
</telerik:RadTreeNode>
                   
</Nodes>
               
</telerik:RadTreeNode>
           
</Nodes>
       
</telerik:RadTreeView>
   
</div>
</
form>

See Also

RadTreeView
RadTreeNode

Yazı kategorisi: TreeView | » yorum bırak;