Jump to content

Recommended Posts

Posted

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.

1978152699_Statusscreen.thumb.jpg.6e1db9fb201559e53d518aaf30318e47.jpg

Posted

OK - there's an easy answer to this - use InputfieldPage with InputFieldSelect, rather than InputFieldPageListSelect.

Perhaps - when I get the related js working! - Works.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...