Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

KTDataTable


Hello,


const myData = ref<Array<any>>([]);
const getRulesList = computed(() => {
return store.getRulesGetAll;
});
onMounted(async () => {
await getRules();

myData.value.splice(0, getRulesList.value.length, ...getRulesList.value);
});

const search = ref<string>("");
const searchItems = () => {
getRulesList.value.splice(0, getRulesList.value.length, ...myData.value);
if (search.value !== "") {
let results: Array<any> = [];
for (let j = 0; j < getRulesList.value.length; j++) {
if (searchingFunc(getRulesList.value[j], search.value)) {
results.push(getRulesList.value[j]);
}
}
getRulesList.value.splice(0, getRulesList.value.length, ...results);
}
};

const searchingFunc = (obj: any, value: string): boolean => {
for (let key in obj) {
if (!Number.isInteger(obj[key]) && !(typeof obj[key] === "object")) {
if (obj[key].indexOf(value) != -1) {
return true;
}
}
}
return false;
};


I keep getting this error for search function
obj[key].indexOf is not a function shocked

Please help me.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Melih,

Thank you for reaching out to us.

Could you please specify which Metronic version are you using?

Do you have the same issue on our preview page?
https://preview.keenthemes.com/metronic8/vue/demo1/#/dashboard

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(