Skip to content

MultiSelect TagHelper's DataSource with disabled server-operation and server-paging sets unexpected default "page" and "pageSize" values #6177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
IvanDanchev opened this issue Dec 4, 2020 · 1 comment

Comments

@IvanDanchev
Copy link
Contributor

Bug report

The tag helper's dataSource sets the following values: "page"=1 and "pageSize"=20, even though "server-operation" and "server-paging" are disabled in its configuration.

Reproduction of the problem

MultiSelect configuration:

<kendo-multiselect name="multiselect1" style="width:100%"
				   placeholder="Enter name..."
				   datatextfield="ShipName"
				   datavaluefield="OrderID"
				   min-length="2"
				   enforce-min-length="true">
	<datasource type="DataSourceTagHelperType.Ajax" server-operation="false"
				server-paging="false"
				server-filtering="false"
				server-aggregates="false"
				server-grouping="false"
				server-sorting="false">
		<transport>
			<read url="@Url.Action("GetData","Home")" />
		</transport>
	</datasource>
	<popup-animation>
		<open duration="500" />
		<close duration="500" />
	</popup-animation>
</kendo-multiselect>

Action:

public ActionResult GetData([DataSourceRequest] DataSourceRequest request)
{
    var result = Enumerable.Range(0, 50).Select(i => new OrderViewModel
    {
        OrderID = i,
        Freight = i * 10,
        OrderDate = new DateTime(2016, 9, 15).AddDays(i % 7),
        ShipName = "ShipName " + i,
        ShipCity = "ShipCity " + i
    });

    var dsResult = result.ToDataSourceResult(request);
    return Json(dsResult);
}

Current behavior

The "page" and "pageSize" values are set, which results in only 20 items being displayed, even though more are returned by the "read" action.

Expected/desired behavior

The "page" and "pageSize" should not be set, and the MultiSelect should display all the data returned by the "read" action.

Environment

  • Kendo UI version: 2020.3.1118
  • jQuery version: x.y
  • Browser: [all]
@veselints veselints self-assigned this Dec 18, 2020
@kendo-bot kendo-bot added FP: Planned Sync status with associated Feedback Item FP: In Development Sync status with associated Feedback Item and removed FP: Unplanned Sync status with associated Feedback Item FP: Planned Sync status with associated Feedback Item labels Dec 18, 2020
@veselints
Copy link
Contributor

veselints commented Dec 18, 2020

The issue is a valid one for the DataSource Tag helper. Nevertheless, I would recommend avoid using AJAX DataSource when no server operations are expected. Having that said, the correct configuration of the DataSource would be:

<datasource>
    <transport>
         <read url="@Url.Action("GetData","Home")" />
    </transport>
</datasource>

While the controller action should simply return a list of items:

public ActionResult GetData()
{
    var result = Enumerable.Range(0, 50).Select(i => new OrderViewModel
    {
        OrderID = i,
        Freight = i * 10,
        OrderDate = new DateTime(2016, 9, 15).AddDays(i % 7),
        ShipName = "ShipName " + i,
        ShipCity = "ShipCity " + i
    });

    return Json(result);
}

@Dimitar-Goshev Dimitar-Goshev changed the title MultiSelect tag helper's dataSource sets default "page" and "pageSize" values MultiSelect tag helper's dataSource with disabled server-operation and server-paging sets default "page" and "pageSize" values Feb 10, 2021
@Dimitar-Goshev Dimitar-Goshev added this to the 2021.R1.SP.next milestone Feb 10, 2021
@kendo-bot kendo-bot added FP: Completed Sync status with associated Feedback Item and removed FP: In Development Sync status with associated Feedback Item labels Feb 10, 2021
@Dimitar-Goshev Dimitar-Goshev changed the title MultiSelect tag helper's dataSource with disabled server-operation and server-paging sets default "page" and "pageSize" values MultiSelect TagHelper's DataSource with disabled server-operation and server-paging sets unexpected default "page" and "pageSize" values Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants