-
Notifications
You must be signed in to change notification settings - Fork 36
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 json data #2
Comments
The way this is implemented right now is that you would need to load all data before loading the table. |
First, off, let me say this makes handsontable gorgeous. I'm fine with loading all the data before loading the table -- but don't know how to go about doing that. I've tried using a hard coded variable in place of the values for data: in the chosenOptions, but to no avail. The list of values works fine as a literal string. I've tried putting a variable with just the id and label within the square brackets. I've tried including the square brackets in the variable. I've tried JSON.stringify(test). Is there any way to do this so that at load time I can set a list of values for the value list? I don't want to modify the list during usage, just at load I want to give it the values needed. |
Doesn't the example from https://github.com/mydea/handsontable-chosen-editor work for you? E.g.: chosenOptions: {
data: [
{
id: "SPOT",
label: "Spot"
}, {
id: "AFLOAT",
label: "Afloat"
}, {
id: "PREORDER",
label: "Preorder"
}
]
} |
Yes, that example works wonderfully. However, what I was trying to do was to have those values be represented by a variable. Something that could be loaded before everything else and then used. I worked more with it this morning. My struggle was getting the array of objects together. A simplified final example of my data that worked is here. var myListOfValuePairs = [{ id:"299", label: "Accent Tables"},{ id:"248", label: "Accessories"}] chosenOptions: { Thank you for responding, and hopefully this helps anybody else that comes along. |
Hi, it is possible to use ajax call to get json data? thanks a lot
The text was updated successfully, but these errors were encountered: