This is a migrated thread and some comments may be shown as answers.

Syntax for specifying transport url as a function

2 Answers 291 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Jane
Top achievements
Rank 1
Jane asked on 28 Apr 2017, 06:29 AM

The documentation says that the transport.read.url can be specified as a function.  Could you please tell me the syntax for doing this using UI for JSP?  

<kendo:dropDownList name="module" dataTextField="domainValue" dataValueField="domainId" optionLabel="Please Select..." id="module">
    <kendo:dataSource>
        <kendo:dataSource-transport>
            <kendo:dataSource-transport-read url=getTestModuleUrl() contentType="application/json"/>
        </kendo:dataSource-transport>
    </kendo:dataSource>
</kendo:dropDownList>

A string is expected for the url but if I do that, then the string is taken literally, and not as a function.  Could you please tell me the correct syntax?

Thank you.

2 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 02 May 2017, 06:28 AM
Hello Jane,

The correct Read action function syntax is shown in the following Documentation article. Note that you will need to nest a <script> tag defining the function within the <kendo:dataSource-transport-read-url> tag.

Regards,
Veselin Tsvetanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
MELWIN
Top achievements
Rank 1
Iron
answered on 16 Mar 2022, 05:32 PM
We are also facing same problem
Veselin Tsvetanov
Telerik team
commented on 17 Mar 2022, 06:05 AM

Hi Melwin,

Could you explain what problem do you face? Do you follow the suggested approach from the documentation?

<kendo:dataSource-transport-read>
    <kendo:dataSource-transport-read-url>
        <script>
            function(e) {
                // Code to handle the url event.
            }
        </script>
    </kendo:dataSource-transport-read-url>
</kendo:dataSource-transport-read>

Tags
DropDownList
Asked by
Jane
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
MELWIN
Top achievements
Rank 1
Iron
Share this question
or