-
Notifications
You must be signed in to change notification settings - Fork 153
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
[Proposal] Pass all data vars via AJAX calls #60
Comments
@patrickheeney Thank you for you proposal. I have actually been meaning to kill |
@paltman Im not sure we are on the same page. How is the server filtering out what it doesnt want when its all passed as POST params. In most applications you simply Secondly, how would the data be flat? You can accomplish all of the same things as you do now the only difference is instead of cramming all your data into data-json you can decouple that logic and reuse it in individual data attributes. I don't see how
Is a nicer syntax and more robust then:
You are essentially inventing your own custom data attribute format when you can leverage the power of what already exists. |
@patrickheeney I wanted to get away from my own invested data format and instead just use JSON. By getting replacing |
@paltman Sounds interesting but by allowing complex nested data structures are you going to loop through the entire json data structure to detect if they used |
@patrickheeney you have given me some things to think about. let me stew on them a bit. thanks! |
Instead of having to explicitly create a data-data="var1:1,var2:#var2" attribute, wouldn't it be better to loop through all data variables and pass them into the ajax calls.
For example on the current version:
Could be changed to:
I know it doesn't look like much but the benefits are great. For example in the first one I have to declare data-page="1" in addition to adding it to the data-data="" because I use some javascript to manipulate the page using the data-page attribute. However I also need to pass it to the ajax request to use it server side. Another benefit is that we gain access to all the existing functionality such as knowing the method (get or post) to check for variables, what partials we are replacing, etc.
It could be made backwards compat by checking for data-data and using that else passing all data attributes.
The text was updated successfully, but these errors were encountered: