Headers in data manager

Hi support, this  i my dropdown list:

<ejs-dropdownlist id="customers" locale="it-IT" ejs-for="People.TitleId" width="100%" placeholder="Selezionare un titolo" created="listTitleCreate">
   <e-dropdownlist-fields id="Id" text="TitleAbbr" value="Id"></e-dropdownlist-fields>
   <e-data-manager id="titlesDataManager" url="http://localhost:5400/odata/Titles" adaptor="ODataV4Adaptor" crossDomain="true" headers="?????"></e-data-manager>
</ejs-dropdownlist>

How can i set the headers parameter to achieve the  authorization ??

I've found no docs about this.
Thanks
Stefano

7 Replies

DR Dhivya Rajendran Syncfusion Team July 3, 2018 12:12 PM UTC

Hi Stefano, 
Thanks for contacting Syncfusion support. 

We have validated your query and you can achieve your requirement by using the below way. In the below code example we have applied value[ myData = 3232323 ]  for header property of data manager. 

Kindly refer to the below code example for more information. 

<ejs-dropdownlist id="customers" locale="it-IT" ejs-for="People.TitleId" width="100%" placeholder="Selezionare un titolo" created="listTitleCreate"> 
 
    <e-dropdownlist-fields id="Id" text="TitleAbbr" value="Id"></e-dropdownlist-fields> 
 
    <e-data-manager id="titlesDataManager" adaptor="ODataV4Adaptor" crossDomain="true"  
    headers='new object[]{ new { myData = 3232323 } }'></e-data-manager> 
</ejs-dropdownlist> 

Regards,
R.Dhivya 



SC Stefano Capobianco July 4, 2018 08:42 AM UTC

Hi R.Dhivya, thank your for your answer. The solution work very well, now i've another problem.

This is my DropDownList

"
<ejs-dropdownlist id="title" ejs-for="People.TitleId" locale="it" >
     <e-data-manager crossDomain="true" url="http://localhost:5400/odata/Titles" adaptor="WebApiAdaptor"
                                                                    headers="new object[]{ new { Authorization = @token  } }"></e-data-manager>
     <e-dropdownlist-fields text="TitleAbbr" value="Id" id="Id"></e-dropdownlist-fields>
</ejs-dropdownlist>
"
As you can see i wont to select th id from the ddl coming from a lookup table and put inside my model field.

At run time i've the following error:

ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.String'.

How can i resolve this ?

Thanks in advance
Stefano



KV Karthikeyan Viswanathan Syncfusion Team July 5, 2018 02:42 PM UTC

Hi Stefano, 
 
Thanks for your update. 
 
We already known “datatype changes in value property” issue in DropDownList. So, we have included this issue fix in 16.2.41 version Nuget package. Kindly upgrade to this version in your sample. 
  
Regards, 
Karthikeyan V. 



SC Stefano Capobianco July 5, 2018 04:52 PM UTC

Hi Karthikeyan V. i'm alrteady in 16.2.0.41.

Thanks
Stefano


KV Karthikeyan Viswanathan Syncfusion Team July 6, 2018 11:36 AM UTC

Hi Stefano,  
  
Sorry for this confusion.  
 
We have refresh the Nuget package with including “DropDownList datatype changes in value property” issue fix in 16.2.43 version. So, Kindly upgrade to this Nuget package in your sample.  We hope this clarifies your query.  
 
Please find the Nuget package link: https://www.nuget.org/packages/Syncfusion.EJ2/  
   
Regards,  
Karthikeyan V 



SC Stefano Capobianco July 6, 2018 11:49 AM UTC

Thanks Karthikeyan V. . You have moved directly at nuget. Ths js1 it's ever at the same link ?

When the it's possible to have the local reports with the js2?

Thanks
Stefano


KV Karthikeyan Viswanathan Syncfusion Team July 9, 2018 09:53 AM UTC

Hi Stefano,   
   
An Essential JS1 ASP Core have a separate Nuget package manager. It have an different tag-prefix and models compared to JS2. 
 
Please refer the UG Documentation link: https://help.syncfusion.com/aspnet-core/nuget-packages  
 
And also We will include this fix in upcoming SP1. It will be available at end of July month.  
    
Regards,   
Karthikeyan V.  


Loader.
Up arrow icon