We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

recover DropDownList name or pass additional parameters on clientEvents

Thread ID:

Created:

Updated:

Platform:

Replies:

125442 Aug 18,2016 04:47 AM Aug 19,2016 07:42 AM ASP.NET MVC 1
loading
Tags: DropDownList
Juan Acosta
Asked On August 18, 2016 04:47 AM

Hi.

I have a dropdownList

@Html.EJ().DropDownList("containersList").Datasource((IEnumerable<DocTracerPortal.Models.Visual.VisualContainer>)ViewBag.containersSource).DropDownListFields(f => f.Value("parentId").Text("text")).CascadeTo("areasList,documentCategoriesList,documentCategoriesList,documentStatusList,documentActionList").EnableRTL(true).ClientSideEvents(e => e.Change("onItemContainerChange"))

I want to recover the dd id on the Event 

function onItemContainerChange(args)
{
 var currentTarget = args.currentElement;
var parentID = $(currentTarget)[0].id;
}

I used that kind of call to get the values from a treeview. I will have that event connected to multiple instances. 
But, I cannot find the way to pass a parameter in the event call, for instance ClientSideEvents(e => e.Change("onItemContainerChange(verify)"))

And if I try to check args, args return the model value of the dropdownlist but it does not contain the object parent reference that triggers the event initially. 

args
Object {
text: "ACT/NSW", selectedText: "ACT/NSW", itemId: 0, selectedValue: 1, value: 1…
}
cancel: falseisChecked: true
isInteraction: true
itemId: 0
model: Object
selectedText: "ACT/NSW"
selectedValue: 1
text: "ACT/NSW"
type: "change"
value: 1__proto__: Object

There is any way to do this. 



Kasithangam C [Syncfusion]
Replied On August 19, 2016 07:42 AM

Hi Juan,   
Thanks for contacting Syncfusion support.   
Query 1: I want to recover the dd id on the Event. I used that kind of call to get the values from a treeview. I will have that event connected to multiple instances.    
 We can get the current control id in the change event by using the “this.element[0].id” as shown below code:   
 
<code> 
 
function onItemContainerChange(args) { 
      var currentTarget = this.element[0].id; 
    } 
</code> 
 
 In this, you can get the current target element id of the desired component. Also, the corresponding component selected value in the args.model. For example, if you need to get the Dropdownlist selected value in change event, then you can get the value by using the args.model.value.   
 
We have prepared the sample based on this and it is available under the following link: 
 
Sample: Sample 
 
Also, we need to clarify that whether the given sample meets your requirement or we misunderstood, if so please provide more details about the requirement and it will be easy for us to provide the exact solution.    
 
Query 2: I cannot find the way to pass a parameter in the event call, for instance ClientSideEvents(e => e.Change("onItemContainerChange(verify)")).And if I try to check args, args return the model value of the dropdownlist but it does not contain the object parent reference that triggers the event initially.  
 
We have created new incident for this query. A support incident to track the status of this issue has been created under your account. Please log on to our support website to check for further updates.   
  
Regards, 
Kasithangam 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;