can't mark tasks as complete using the check mark

  • 1
  • Question
  • Updated 5 years ago
  • Answered
I am using task tables using pretty much the code found here:
the green check box to mark tasks complete is not working.
is there an issue with the code on this sample page?
Photo of Brandon Gage

Brandon Gage

  • 376 Points 250 badge 2x thumb
  • sad

Posted 6 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,828 Points 20k badge 2x thumb
Well the link in the tutorial to our page repository was old and moldy.  Here is a better link to a sample page that has the task table working correctly.

Let me know if this still gives you trouble. 

Photo of Joel Knutson

Joel Knutson, Alum

  • 474 Points 250 badge 2x thumb
Hi Brandon, I just tested our sample page, and it is working. Try this one and see if it works:

skuid.snippet.registerSnippet('tasks.markCompleted',function(params){ // Mark all selected items as closed, // then save our 2 Tasks models var model = params.model, list = params.list, selectedItems = params.item ? [params.item] : list.getSelectedItems(); if (selectedItems.length === 1 && skuid.model.isNewId(selectedItems[0].row.Id)) { alert('Please finish creating this Task before marking it as completed.'); return; } $j.each(selectedItems,function(i,item){ model.updateRow(item.row,'Status','Completed'); }); // Block the list from having updates list.element.block({ css: list.blockUICSS, overlayCSS: list.blockOverlayCSS, message:'Marking Tasks as Completed...' }); var saveFinishes ={callback: function(){ var updateFinishes = skuid.model.updateData([model,skuid.model.getModel('TaskHistory')]); $j.when(updateFinishes).then( function(){ list.element.unblock(); }, function(){ list.element.unblock(); } ); } }); });
Photo of Shanna Leslie

Shanna Leslie

  • 70 Points
Hi Joel,

I am working with Brandon on this and the code that we are using is exactly the same as you posted. It only works the first time. Could there be a caching issue here? We are using Chrome.

Photo of John Nelson

John Nelson, Product Manager

  • 3,356 Points 3k badge 2x thumb
Shanna or Brandon, are you guys seeing any javascript errors in the console when you run it the second time?
Photo of Shanna Leslie

Shanna Leslie

  • 70 Points
No. It just doesn't seem to execute the second time.
Photo of John Nelson

John Nelson, Product Manager

  • 3,356 Points 3k badge 2x thumb
Shanna, would you grant Skuid access so I can take a look at this? 
Photo of Vijay Goel, M.D.

Vijay Goel, M.D.

  • 60 Points
For me, the code posted on works, but in Chrome I it hangs (item is marked complete, but page hands with gray overlay and words: "Marking tasks as completed"
In the console I get the error:

Uncaught TypeError: Converting circular structure to JSON skuid__SkuidJS:4
(anonymous function)VFRemote.js:40

Is there anything you would suggest to make the page work?

Photo of Louis Skelton

Louis Skelton

  • 5,500 Points 5k badge 2x thumb
I had this issue and it was because I hadn't linked the snippet to the correct model as referenced in the lower part of the snippet code (I was using a model named 'Tasks' rather than 'TaskHistory'). Yours might be hanging for a different reason though...

var saveFinishes ={callback:
                        var updateFinishes = skuid.model.updateData([model,skuid.model.getModel('Tasks')]);
                            function(){ list.element.unblock(); },
                            function(){ list.element.unblock(); }