Telerik Forums
Kendo UI for jQuery Forum
8 answers
1.1K+ views
I've looked through the demos and docs but am still scratching my head.

My goal is to present the user with a filterable drop down list which fetches "paged" data from the server as the user scrolls down.

The scenario is that I don't want to retrieve 1000's of rows from the database at once, instead I want to fetch a page (page size = 100) of data at a time, and stream that data as needed as the user scrolls down.  But the example I see here (http://demos.telerik.com/aspnet-mvc/dropdownlist/virtualization) doesn't appear to do this, nor can I find anything to explain how this would be done.

Indeed, that demo (http://demos.telerik.com/aspnet-mvc/dropdownlist/virtualization) uses a Controller that appears to fetch ALL rows from the database multiple times, is that correct? I'm lost when it comes to the value mapper function as it accepts a parameter of int[] values, then AGAIN fetches ALL rows from the database, loops through ALL those rows, attempting to find and generate an index for each passed-in value...

Isn't the point of implementing virtualization and paging to make it so that we're limiting the amount of data returned from the database?  Or is the actual/only benefit that we're not delivering a huge payload to the browser (ignoring any performance issue with the database)?

Georgi Krustev
Telerik team
 answered on 07 Feb 2017
2 answers
121 views
I am building a point of sale system using Kendo UI. The POS page will have a header section and then a grid to handle sale line items. The user needs to be able to enter lines items (up to 100 or more in a sale) very quickly. Ideally I don't want to force the user to have to reach for the mouse and click the  Add New Record button each time he/she wants to enter a new line item (row) in the grid. This is going to be too slow and awkward. What I would really like is for the grid to automatically start a new row as soon as the user enters a value in the last column of the last row in the grid and moves off the column. I don't see anyway to have the Kendo grid do this. Is it possible?
Randy
Top achievements
Rank 1
 answered on 06 Feb 2017
1 answer
3.7K+ views

Hi --

We have a grid with an action button in the column. When the user clicks the button this code executes.

function showDetails(e) {
     e.preventDefault();
 
     var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
     var grid = $("#gridEnrollments").data("kendoGrid");
     grid.select($(e.currentTarget).closest("tr"));
 
     selectedIndex = grid.select().index();
}

 

The selected row index value is now in the selectedIndex variable.

I would like to then be able to do grid.select(selectedIndex +1).

However, when I do this the selected row is the one above as opposed to below the currently selected row.

How can I achieve what I am looking to do?

Thanks

Rich

 

 

 

 

Eduardo Serra
Telerik team
 answered on 06 Feb 2017
1 answer
145 views

Hi,

I'm using Scatter Chart.

However , when I have a large dataset (around 20,000 data points).

 

The chart renders very slowly (around 20 seconds)

Any ideas ? (I already tried to render it as canvas)

Thanks

Sagi

 

Eduardo Serra
Telerik team
 answered on 06 Feb 2017
1 answer
137 views

Hi,

Is there any way to block the onchange method of the spreadsheet conditionally? My use case is below:

When our users click on the spreadsheet, we getthe top selected row and add some dropdowns (validations) to it (I cannot do this on spreadsheet initialisation as the speed is too slow). However, this forces the onchange method to fire a number of times. The onchange method watches certain columns, as when users change the actual value we need to recalculate things. Is there any way in the onchange method, to work out if the "change" was just adding validation to the cell, as this is all we do in the onclick method?

Thanks

Marc

Eduardo Serra
Telerik team
 answered on 06 Feb 2017
2 answers
383 views
We are trying to do data binding with multiple levels of function calls in order to tidy our base model (not having all of our functions related to some requirements in our model root's)

So let says our model is as following (expressed in typescript for clarity) :

class MyModel extends kendo.data.ObservableObject {
    EnabledDate() { return false; }
}

and we have a the data-binding expressed as following :

<div data-role="datepicker" data-bind="enabled:EnabledDate"></div>

or (with parentheses)

<div data-role="datepicker" data-bind="enabled:EnabledDate()"></div>
Ok -> These both works perfectly, as expected the datepicker is disabled !

( But please note, strangely :

<div data-role="datepicker" data-bind="enabled:UnexistingEnabledDate()"></div>
 --> generate an error : TypeError: d.UnexistingEnabledDate is not a function

while

<div data-role="datepicker" data-bind="enabled:UnexistingEnabledDate"></div>
--> gives no error, but the widget is not disabled !
)


Now, if we want to tidy our model and group "Enabled/Disabled" in a specialized class, let say :

class MySpecializedModel extends kendo.data.ObservableObject {
    EnabledDate() { return false; }
}
our model becomes :

class MyModel extends kendo.data.ObservableObject {
    private _specializedInstance: MySpecializedModel;

    GetSpecializedInstance():MySpecializedModel {
         if (this._specializedInstance == undefined) {
             this._specializedInstance = new MySpecializedModel();   
         }
         return this._specializedInstance;
    }
}

and our data-bind attribute in markup has to be modified, but we can't find a working way of accessing EnabledDate via GetSpecializedInstance.

We tried the following :
<div data-role="datepicker" data-bind="enabled:GetSpecializedInstance.EnabledDate"></div>
--> no javascript errors, but the binding is not working (widget not disabled as expected)
<div data-role="datepicker" data-bind="enabled:GetSpecializedInstance().EnabledDate"></div>
--> TypeError: e.bind is not a function
<div data-role="datepicker" data-bind="enabled:GetSpecializedInstance().EnabledDate()"></div>
--> no javascript errors and correctly binded, but infinite loop (too much recursion) occurs later on, while it does not occur with the "EnabledDate" working binding scheme

<div data-role="datepicker" data-bind="enabled:GetSpecializedInstance.EnabledDate()"></div>
--> TypeError: (intermediate value).EnabledDate is not a function

We also tried accessing SpecializedInstance as a getter property instead of a function by modifying MyModel class with the following code :
class MyModel extends kendo.data.ObservableObject {
    private _specializedInstance: MySpecializedModel;

    get SpecializedInstance(): MySpecializedModel{
        if (this._specializedInstance == undefined) {
             this._specializedInstance = new MySpecializedModel();  
         }
         return this._specializedInstance;
    };
    set SpecializedInstance(value: MySpecializedModel) {
        this._specializedInstance= value;
    };
}

and the following markup gave the following errors :
<div data-role="datepicker" data-bind="enabled:SpecializedInstance.EnabledDate"></div>
--> TypeError: e.bind is not a function

<div data-role="datepicker" data-bind="enabled:SpecializedInstance().EnabledDate"></div>

--> TypeError: d.SpecializedInstance is not a function

<div data-role="datepicker" data-bind="enabled:SpecializedInstance().EnabledDate()"></div>
--> TypeError: d.SpecializedInstance is not a function

<div data-role="datepicker" data-bind="enabled:SpecializedInstance.EnabledDate()"></div>

--> no javascript errors and correctly binded, but infinite loop (too much recursion) occurs later on, while it does not occur with the "EnabledDate" working binding scheme


So, what is the correct syntax when binding with such multiple functions calls level ?

Thanks for your support !

We are trying to do data binding with multiple levels of function calls in order to tidy our base model (not having all of our functions related to some requirements in our model root's)

 

So let says our model is as following (expressed in typescript for clarity) :

 

class MyModel extends kendo.data.ObservableObject {
    EnabledDate() { return false; }

}

 

and we have a the data-binding expressed as following :

<div data-role="datepicker" data-bind="enabled:EnabledDate"></div>

 

or (with parentheses)

<div data-role="datepicker" data-bind="enabled:EnabledDate()"></div>

Ok -> These both works perfectly, as expected the datepicker is disabled !

 

( But please note, strangely :

<div data-role="datepicker" data-bind="enabled:UnexistingEnabledDate()"></div>

 --> generate an error : TypeError: d.UnexistingEnabledDate is not a function

while

<div data-role="datepicker" data-bind="enabled:UnexistingEnabledDate"></div>

--> gives no error, but the widget is not disabled !

)

Now, if we want to tidy our model and group "Enabled/Disabled" in a specialized class, let say :

class MySpecializedModel extends kendo.data.ObservableObject {
    EnabledDate() { return false; }
}

our model becomes :

class MyModel extends kendo.data.ObservableObject {
    private _specializedInstance: MySpecializedModel;
     
    GetSpecializedInstance():MySpecializedModel {
         if (this._specializedInstance == undefined) {
             this._specializedInstance = new MySpecializedModel();   
         }
         return this._specializedInstance;
    }
}

 

and our data-bind attribute in markup has to be modified, but we can't find a working way of accessing EnabledDate via GetSpecializedInstance.

 

We tried the following :

<div data-role="datepicker" data-bind="enabled:GetSpecializedInstance.EnabledDate"></div>

--> no javascript errors, but the binding is not working (widget not disabled as expected)

<div data-role="datepicker" data-bind="enabled:GetSpecializedInstance().EnabledDate"></div>

--> TypeError: e.bind is not a function

<div data-role="datepicker" data-bind="enabled:GetSpecializedInstance().EnabledDate()"></div>

--> no javascript errors and correctly binded, but infinite loop (too much recursion) occurs later on, while it does not occur with the "EnabledDate" working binding scheme

<div data-role="datepicker" data-bind="enabled:GetSpecializedInstance.EnabledDate()"></div>

--> TypeError: (intermediate value).EnabledDate is not a function

 

We also tried accessing SpecializedInstance as a getter property instead of a function by modifying MyModel class with the following code :

class MyModel extends kendo.data.ObservableObject {
    private _specializedInstance: MySpecializedModel;
 
    get SpecializedInstance(): MySpecializedModel{
        if (this._specializedInstance == undefined) {
             this._specializedInstance = new MySpecializedModel();  
         }
         return this._specializedInstance;
    };
    set SpecializedInstance(value: MySpecializedModel) {
        this._specializedInstance= value;
    };
}

 

and the following markup gave the following errors :

<div data-role="datepicker" data-bind="enabled:SpecializedInstance.EnabledDate"></div>

--> TypeError: e.bind is not a function

<div data-role="datepicker" data-bind="enabled:SpecializedInstance().EnabledDate"></div>

--> TypeError: d.SpecializedInstance is not a function

<div data-role="datepicker" data-bind="enabled:SpecializedInstance().EnabledDate()"></div>

--> TypeError: d.SpecializedInstance is not a function

<div data-role="datepicker" data-bind="enabled:SpecializedInstance.EnabledDate()"></div>

--> no javascript errors and correctly binded, but infinite loop (too much recursion) occurs later on, while it does not occur with the "EnabledDate" working binding scheme

 

So, what is the correct syntax when binding with such multiple functions calls level ?

Thanks for your support !

Ianko
Telerik team
 answered on 06 Feb 2017
1 answer
68 views
If I remove the url property on the data item, behavior is normal.
I've got a jsFiddle that demonstrates the problem here. The last node, 'Carpets' has a url property and can't be dropped and won't fire the drag event.
Ivan Danchev
Telerik team
 answered on 06 Feb 2017
1 answer
122 views
We have an editable grid (angular) that's suffering badly with performance. Our customer reports editing grid cell becomes slower and slower and becomes unresponsive very quickly.

We tried to dig into the problem, and notice the angular watch # increases and digest cycle takes longer to execute as user edit each cell. We use angular expression in cell template, and attaches data-ng-model to the td's attribute. 

Below is demo we created that has similar but much simpler setup as our own grid. It you install Chrome extension AngularJS Batarang, you can use to monitor angular digest cycle time and watch #. You will notice these 2 numbers slowly and steadily increases over time.
https://plnkr.co/edit/s4nhIh?p=preview

It's not too bad of a increase in the above, but our own grid is much larger and much more complicated, and performance suffers badly.

Could you explain why is watch# and digest cycle time increases as I edit cell? It seems to be the <td> DOM is not recreated every time on user enter and exit a cell for edit. 
Stefan
Telerik team
 answered on 06 Feb 2017
1 answer
197 views

I am brand new to Kendo UI. I am curious if it is possible to use a MobileSwitch widget on a Grid to represent a boolean value.  Can we configure the columns of the grid to show another Kendo UI widget?

Where should I go to understand how to build Views that have nested widgets?

Viktor Tachev
Telerik team
 answered on 06 Feb 2017
1 answer
1.0K+ views

Good day!

I know that this is asked frequently, but do you have any options/config to set category labels/axis to auto-wrap?

I know that you can render "\n" as part of the label to have a line break, but in order to do that we have to set a defined length on where to do the line break.

We're making the chart responsive as possible and it will be awkward to look at a chart with a wrapped label when there's a lot of space left.

 

Thanks!

Ollie

Neovation

Dimiter Topalov
Telerik team
 answered on 06 Feb 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?