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.

undefined data("ejListBox")

Thread ID:

Created:

Updated:

Platform:

Replies:

131233 Jun 29,2017 07:36 PM Jul 3,2017 07:42 AM ASP.NET MVC 3
loading
Tags: ListBox
Johanny Valencia Sanchez
Asked On June 29, 2017 07:36 PM

Hi. 

I use visual studio 2017 community and Essential Studio Enterprise Edition - Community license version 15.2.0.40
I have a problem with ListBox, and other controls like Grid. this is my case: 

I created 2 projects with template "Syncfusion ASP.NET MVC Application", in project1 only choose the control ListBox



and project2 choose all controls in Navigation content



in both project add in HomeController this code



in both View About.cshtml add this code



when run the projects in project2(project where choose all controls in item navigation) work fine, when click in guardar button




but when I run project1(only choose control ListBox), I am get this issue



this is because the target is undefined.

I check all projects folder by folder, and they have the same files.

please give me some directions on how to fix this. In other control (Grid) i am get the same issue when use ejGrid, it could be the same error

thanks and good day.

Arun Palaniyandi [Syncfusion]
Replied On June 30, 2017 08:44 AM

Hi Johanny Valencia, 
 
Thanks for contacting Syncfusion Support.    
 
   
We have checked the reported issue and able to reproduce it. While analyzing the shared screenshot, we have found, that the issue is due an ID of the ListBox. We could see the different ListBox ID in the button click event which is technically invalid and hence the object is not created for that ID. Therefore, this throws the console error.   
 


 
             @Html.EJ().ListBox("listboxsample").Width("240").Datasource((IEnumerable<SyncfusionMvcApplication.ListBoxController.skillset>)ViewBag.datasource).ShowCheckbox(true).ListBoxFields(df => 
     df.Text("text")) 
 
<script> 
 
    $("#Guardarstriker").on("click", function () { 
 
        target = $("#listboxsample").data("ejListBox"); // in your screenshot you have given id as #Areas 
        var checkedItems = target.getCheckedItems(); 
    }) 
 
 
</script>     



 
Please find the sample below for reference: 
 
 
Also, we would like to confirm the below details.   
 
·         Whether you are facing this issue even when the id is correct? 
·         Whether you are facing this issue only when the ListBox is created with the sample creator or normally? 
·         As you mentioned in ejGrid also you are getting the same error. So, is it the same issue problem over there? 
 
 
Please check the shared sample, information and if the shared details still doesn’t meet your requirement, please send us the asked information, so that we will provide a solution.         
         
Regards,         
Arun P.     


Johanny Valencia Sanchez
Replied On July 1, 2017 04:45 AM

Thank you, for you response Arun.

It was a beginner error. I did the same correction as the image that you sent me and it worked.

With ejGrid put in comment the line @Scripts.Render("~/bundles/jquery/js") in the _Layout.cshtml and it worked


Thank you for your help. have a nice weekend



Arun Palaniyandi [Syncfusion]
Replied On July 3, 2017 07:42 AM

Hi  Johanny Valencia, 

We are glad that your issue has been resolved. 

Please let us know if you have any queries in future. 

Regards, 
Arun P. 


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.

;