Skip to content
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

Ajax safe default values #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

whizsid
Copy link

@whizsid whizsid commented Jul 5, 2019

Currently component will giving an error in console when we set "data-id"="1,4" and ajax will not loaded an object with id 4. This PR will fix it.

Uncaught TypeError: Cannot read property 'id' of undefined

This PR is also filtering the duplicated objects with same ids.

Usage:-

$('#basic').magicsearch({
        // You can use this property with any type. (ajax,multiple...)
         defaultValue:{id: 10, firstName: 'Bruce', lastName: 'Wayne'},
         // Or we can use an array
         defaultValue:[
              {id: 10, firstName: 'Bruce', lastName: 'Wayne'},
              {id: 9, firstName: 'Tony', lastName: 'Well'}
         ],
});

Old attr-id default values method is not overridden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant