MarkE Posted May 19, 2020 Share Posted May 19, 2020 I have built a property booking status screen (see partial pic at end) that works very nicely on my dev machine. However, when on the remote server, it is very slow to load as there are about 70 InputfieldPageListSelect fields, each of which appears to do a request to processwire/page/list/?id=... Over the internet, 70 such requests takes an appreciable time. I've been scratching my head and getting only splinters in my fingers ... does anyone have any ideas for strategies to speed this up? Although there are 60-70 lines, each with a "tariff" field, there are only about 6 tariffs, so each page is fetched about 10 or more times. I need each field to have a unique id, though, so that I can update it via Ajax if the user changes it (see code below). // Select tariff $inputFieldTariffSelect = $this->modules->get('InputfieldPageListSelect'); $inputFieldTariffSelect->parent_id = $week->yearPage->id; $inputFieldTariffSelect->attr('name + id', 'tariffId'); $inputFieldTariffSelect->label = ''; $inputFieldTariffSelect->value = $week->tariffPage->id; $inputFieldTariffSelect->attr('data-action', 'form-update'); // selector for jquery on change $inputFieldTariffSelect->attr('data-update-target', '#innerWrap' . $week->id); // need week id to make unique $inputFieldTariffSelect->attr('data-update-reply', '#tariffAmount' . $week->id); $inputFieldTariffSelect->wrapAttr('style', 'width: 50%;'); $formTariff->append($inputFieldTariffSelect); I'd be very grateful for any thoughts or pointers. Link to comment Share on other sites More sharing options...
MarkE Posted May 19, 2020 Author Share Posted May 19, 2020 OK - there's an easy answer to this - use InputfieldPage with InputFieldSelect, rather than InputFieldPageListSelect. Perhaps - when I get the related js working! - Works. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now