EXT.NET v3.0 BETA RELEASED!
Now with Tablet Support!
Ext.NET v3.0 Beta is here with lots of new cool features and now with tablet support! Check Examples Explorer now to see it in action or download and test it yourself for free!
Results 1 to 3 of 3

Thread: Code behind ExtraParams

  1. #1
    Member
    Join Date
    Oct 2011
    Location
    Cyprus
    Posts
    52

    Code behind ExtraParams

    In Code behind you can nicely hook an event on TreePanel
    like this
    Code:
     Ext.Net.TreePanel tr = new Ext.Net.TreePanel();
     tr.DirectEvents.Click.Event += nodeClicked;
    however if lets say node has attributes how we pass it on extra params ???
    Code:
      Ext.Net.Parameter prm = new Ext.Net.Parameter();
      prm.Value ="{#{" + tr.ID + "}.node.attributes.tagName}"; //this does not work. Any ideas????
      prm.Name = "ReportID";
      tr.DirectEvents.Click.ExtraParams.Add(prm);

  2. #2
    Ext.NET - Dev Team geoffrey.mcgill's Avatar
    Join Date
    Jan 2008
    Location
    Canada
    Posts
    8,679
    Hi,

    Is this code throwing a JavaScript error? If you use Firefox with the Firebug extension, does Firebug log any errors or exceptions?

    What if you use the following:

    Example

    Code:
    Ext.Net.Parameter prm = new Ext.Net.Parameter();
    prm.Value = "#{" + tr.ID + "}.node.attributes.tagName"; //this does not work. Any ideas????
    prm.Name = "ReportID";
    prm.Mode = ParameterMode.Raw;
    tr.DirectEvents.Click.ExtraParams.Add(prm);
    Providing a simplified code sample demonstrating the whole scenario will help narrow down the problem.
    Geoffrey McGill
    Ext.NET, Inc.
    Founder, and Dev Team

    Ext.NET Examples | Ext.NET API Docs | ExtJS API Docs | @extnet | Jobs

  3. #3
    Member
    Join Date
    Oct 2011
    Location
    Cyprus
    Posts
    52
    Thank you for replying
    previously the the parameter was not coming as numeric value but as whole statement so if i wanted to consume extra parameter it was something like "node.attributes.tagName" after adding prm.Mode = ParameterMode.Raw; Script fails to load. Firebug gives a message missing : after id
    the scenarion is that when the tree is created I am adding some custom attributes to leaf nodes . like this
    Code:
    trNode.CustomAttributes.Add(new ConfigItem(string.Format("'{0}'", xAttr.Name), string.Format("'{0}'", xAttr.Value)));
    when user clicks the leaf node I want to consume that attributes so hook up direct event
    Code:
     tr.DirectEvents.Click.Event += nodeClicked;
     tr.ID = xNode.Name;
     Ext.Net.Parameter prm = new Ext.Net.Parameter();
     prm.Value = "{ #{" + tr.ID + "}.node.attributes.ReportID } ";
     prm.Name = "ReportID";
     prm.Mode = ParameterMode.Raw;
     tr.DirectEvents.Click.ExtraParams.Add(prm);

Similar Threads

  1. Replies: 6
    Last Post: Aug 01, 2011, 5:53 PM
  2. AjaxFormResult && ExtraParams
    By threewonders in forum 1.x Help
    Replies: 1
    Last Post: Jun 28, 2011, 8:30 AM
  3. more than one extraparams from a gridpanel
    By unaltro2 in forum 1.x Help
    Replies: 1
    Last Post: Jun 07, 2011, 5:35 PM
  4. Combobox value with ExtraParams
    By ulrikn in forum 1.x Help
    Replies: 1
    Last Post: Feb 09, 2011, 11:46 AM
  5. How to use ExtraParams ?
    By iscript in forum 1.x Help
    Replies: 1
    Last Post: Aug 21, 2009, 8:09 AM

Posting Permissions