David David - 3 years ago 55
Javascript Question

How to remove items from combo store

I want to remove some items from the end of my comboStore.

What I am trying that is coming correct but in UI all the data is showing.

Suppose I have 500 data. I want to display only 100 data. How to get that.

What I am trying here is

var ComboStore = this.store.data.items
var ComboStoreLen = ComboStore.length;
if (ComboStoreLen > 100) {
ComboStoreLen.length = 100; // setting the length
}


What I need to restrict in UI. because ComboStore have 500 data.

Answer Source

You cannot restrict in the UI. The UI will always loop over all data that is in the store.

However, you can use a ChainedStore and filter down the records by the index in the original store:

https://fiddle.sencha.com/#view/editor&fiddle/23t1

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download