Customize "Show x items per page"

  • 1
  • Question
  • Updated 4 years ago

We have a use case where we would like to change the custom object name which displays at the bottom of the page. In this case we would like for it to say "Utility Accounts" instead of "Intake Queues". I understand that I can choose not to show the footer, however it would be nice if we can customize it. (Just so you know this is just a nice to have/low priority.)
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,646 Points 5k badge 2x thumb

Posted 4 years ago

  • 1
Photo of JD Bell

JD Bell, Senior Product Engineer

  • 2,996 Points 2k badge 2x thumb
Moshe,

It's a bit "hacky", but you can do this with a custom component.

Add a new custom component to the top of the page (before anything else... it must be the first thing on the page).

In the Custom Component snippet, add the following code:
var IntakeQueues = skuid.model.getModel( 'IntakeQueues' );
IntakeQueues.label = 'Utility Account';
IntakeQueues.labelPlural = 'Utility Accounts';
This code will overwrite the model metadata before anything else on the page is rendered and effectively change the labels for the object anywhere it's used. Note that this will only change the Model on that particular page but will change the label everywhere the Model is used.

We generally recommend that developers treat the metadata as read-only, but obviously in JavaScript nothing is read-only. I don't think that changing the labels would break anything, but you'll need to do your own testing to be sure.

I hope this works as a sufficient solution.

(Since you're not adding any HTML elements to the custom component, it will produce a zero-height DIV element at the top of the page. I doubt that will affect any of your layouts.)