Idea: Update of merge fields in labels with changes in the model

edited October 15, 2019 in Ideas
I have tab labels that uses merge syntax to display the total number of records in a model. When I update and requery that model using action framework, the label does not update so the total number of records shown in the tab label is inconsistent with the number of actual records displayed in the table within that tab. It would be nice if there was a way to trigger update of merge variable values upon requery.
4
4 votes

Awaiting Review Β· Last Updated

Comments

  • Matt SonesMatt Sones πŸ’ŽπŸ’ŽπŸ’Ž
    edited February 10, 2017
    yes!
  • Matt SonesMatt Sones πŸ’ŽπŸ’ŽπŸ’Ž
    edited May 24, 2018
    Raymond, as a temporary work-around I usually run a one-line snippet right after the query, which looks something like this:
    skuid.$C('MyComponentId').render();
  • Matt SonesMatt Sones πŸ’ŽπŸ’ŽπŸ’Ž
    edited February 10, 2017
    Tabsets are not tied to a model, which is the reason they don't re-render automatically on your query.
  • edited October 15, 2019
    You are the best! Thanks
  • edited October 15, 2019
    You are still the best, but I am now realizing that due to the number of components that I do this on and the number of action sequences that lead to updating of models tied to these merge variables on those components, I would have to add this action about 32 times just for my one page. Obviously, it would be preferable if Skuid could know to update them automatically. In the short-term.... Time to get to typing....
  • edited October 15, 2019
    Actually, I'm rethinking it. I should be able to do a model action that updates the components on requery of the model. That bypasses each individual action sequence so I should only have to do it once per model.
  • Karen WaldschmittKaren Waldschmitt πŸ› οΈ ο»Ώ
    edited March 2, 2017
    Gentlemen~

    Raymond, this is an interesting idea. I'll bring it to the team and see what they think about including this in a future release.

    Matt, thanks for your snippet workaround! Glad it works for Raymond in the meantime! Β 

    Thanks!
    Karen
  • edited October 15, 2019
    In the upcoming Brooklyn release, global merges, such as {{$Model.Account.data.length}} will automatically update when the number of records in a Model changes. This will address the principal concern here, where folks are using global merges in Tab labels to show the number of records in the Model whose data is shown in a tab.
  • edited September 30, 2016
    okay, thanks. Β Any workaround until then? Β I am trying to use this to update the tab label

    skuid.$C('sk-1xt3wk-1107').render();

    It works for template id's but not for tab ids?
  • edited May 8, 2017
    Hi Zack,
    I am now onΒ 9.5.5 and I am still not seeing this updating behavior. As an example, I have a tab with a label of
    Service Requests ({{$Model.ServiceRequestDashboard.data.length}})
    The length does not update when I apply table filters or query the model through actions.
  • edited November 16, 2018
    Did this ever get resolved? It seems like the problem still exists.
  • John DahlbergJohn Dahlberg ✭✭✭✭
    edited November 20, 2018
    We've run into a similar issue with the global merge variables not refreshing in a navigation component when a model updates.Β  The Navigation component also doesn't handle the render() function well.Β  This isn't ideal, but the workaround was to wrap the component we needed to refresh with a component that does respect the render() function - a responsive grid in our case, but a wrapper should work as well.
  • edited November 27, 2018
    Thanks for this info John; just to make sure I understand correctly: You're throwing a responsive grid around a navigation component and then using JS to call render()? or is putting the responsive grid around the navigation component by itself sufficient?

    Thanks again!
  • John DahlbergJohn Dahlberg ✭✭✭✭
    edited December 4, 2018
    You have to run the render() function on the responsive grid.Β  This can be a one line snippet run from the action framework.Β  In our case, we have a model that re-queries every 10 seconds and then kicks off a re-usable action that runs the snippet.Β  Like I said, this isn't ideal and causes a screen flicker, but it gets the job done.Β  We're using it for an "Alert" navigation component, kind of like an inbox notification for several types of transactions.Β  The syntax that Chis documented should suffice for the snippet and here's a screenshot of how we're leveraging the solution:

    image:


  • edited December 4, 2018
    Thanks John, I appreciate the clarification!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!