atk4 / ui

Robust and easy to use PHP Framework for Web Apps
https://atk4-ui.readthedocs.io
MIT License
440 stars 105 forks source link

Include JS/CSS resources only once #1875

Open mvorisek opened 1 year ago

mvorisek commented 1 year ago

should be probably solved in atk4/ui

image

see demos

same problem in atk4/ui atk4/ui/demos/interactive/jssortable.php demo

mvorisek commented 1 year ago

related with AJAX/lazy load https://github.com/atk4/ui/pull/1896

DarkSide666 commented 1 year ago

Also there should be a way how any View can request to load additional JS/CSS files on view rendering (if they are not already loaded). That's important when you put View in modal window for example and from server receive only data with cut this view object.

For example, if i have rich text editor which requires additional JS/CSS includes then the only way is to add them globally in whole app. But we only need it in pages (forms, modal forms etc) where this field is actually shown. Probably some way of javascript-based includeJs and includeCss would be good to have for such cases. They could use jquery.getScript() or some other mechanism to load.