skuid.model.updateData() deprecated? Really? How else can we query multiple models in one function?

  • 2
  • Question
  • Updated 7 months ago
  • Answered
According to this, skuid.model.updateData() has been deprecated.

Works in version 11.1.7 without issue.

The proposed workaround is to use skuid.model.Model.update(), but this isn't great as it's for just the one model at a time. I have this code that would be faster since it's querying multiple models at one time. There's also good reason to query at the same. Take cloning as an example. Problematic without updateData() when the models are set to clone always.

var params = arguments[0],
FirstModel = skuid.$M('FirstModel'), SecondModel = skuid.$M('SecondModel'), Entities = skuid.$M('Entities'), models = [FirstModel,SecondModel], $ = skuid.$; var dfd = $.Deferred(); function updateModels(){ $.when(skuid.model.updateData(models)) .done(function(){ if (SecondModel.data.length){ Entities.adoptRows(SecondModel.getRows()); updateModels(); } else { dfd.resolve(); } dfd.resolve(); }) .fail(function(){ dfd.reject(); }); } updateModels(); return dfd.promise();

Did I miss something?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 8 months ago

  • 2
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Official Response
Official response: the following methods are NOT being deprecated, and will continue to work as before in future releases. You may freely and safely continue to use the following methods, they are supported and will continue to work in future releases:

- skuid.model.cancel()
- skuid.model.updateData()
- skuid.model.load()
- skuid.model.save()

These are all still supported and will continue to work as expected in future releases.

We will be adjusting the documentation to correct this misunderstanding, and we apologize for the confusion and alarm that this has caused. We will be removing these methods from the deprecation list in that document.