Why does devextreme customstore ask for a method that is already implemented?

25 Views Asked by At

I'm using devextreme vue, I'm trying to implement asynchronous loading in a select component. I create a customstore like this

  const loadDataSource = (searchValue: string) => {
if (!asyncSettings.value) return
const asyncFunction = asyncSettings.value.asyncFunction
const asyncName = "asyncName"
if (isAsyncComponent && dataSource) {
  dataSource.value = new DataSource({
    store: new CustomStore({
      key: asyncName,
      loadMode: "raw",
      load: async () => {
        isLoaded.value = false
        const dataSource = await asyncFunction(searchValue)
        selectElement.value.instance.field().value = searchValue
        activePlacehodler.value = ""
        return dataSource
      },
      byKey: async function (key) {
        return new Promise(resolve => resolve("succses"))
      },
    }),
  })
}
}

I'm adding a function that does asynchronous loading of elements. But I keep getting the following error

Uncaught (in promise) Error: E4011 - Custom Store method is not implemented or is not a function: byKey. See:
http://js.devexpress.com/error/23_1/E4011

This error asks to install the byKey method, which is already implemented

0

There are 0 best solutions below