Slush bucket - stop removing items from right bucket.

Nithya V Sivara
Tera Contributor

Hi ..I am new to service now. I have a requirement where i need to stop moving items from Right bucket of a slush bucket when a check box is clicked.I tried out many possible ways. but no solution.Please help on this.

Riyaz

5 REPLIES 5

Nithya V Sivara
Tera Contributor

I have check box and a slush bucket.


on clicking the check box, I should make sure no items from the right bucket of the slush bucket gets removed


when the check box is unchecked,I should be able to remove items   from the right bucket.




Tried many options but didnt work.Any suggestions please.


Mark Stanger
Giga Sage

Something like this should work in an 'onChange' catalog client script.   Just add it to your client script and change 'test' to the name of your variable.



if(newValue == true){


//Disable the right-side of the slushbucket for the 'test' variable


$('test_select_1').disabled = true;


}


else{


      //Enable the right-side of the slushbucket for the 'test' variable


    $('test_select_1').disabled = false;


}


Thanks mark.. The code you showed disables the right bucket completely . Can I make only few options of the rightbucket gets transferred to left bucket where as the remaining options remains on the right bucket



Sent from my iPhone


Hi Riyaz,



                        Here is the code to move right bucket to left bucket.







function clearright ()


{



  //this function clears the right slushbucket of var1


  var varname = 'your variablename';


  sourceOptions = gel(varname + '_select_1').options;




  var selectedIds = new Array();



  for (var i = 0; i < sourceOptions.length; i++)


  {



  try


  {



  if(sourceOptions[i].value.toString() == '12433454df3434df' || sourceOptions[i].value.toString() == '56565gfh4565657')


  {


  selectedIds.push(i); // Here we are pushing the position of the choice which ever i would like to move


  }



  }


  catch(e)


  {


  alert(e.message);


  }



  }




  moveSelectedOptions(selectedIds, gel(varname + '_select_1'), gel(varname + '_select_0'), '--None--'); //This function can move from right to left


  sortSelect(gel(varname + '_select_0'));


}






For your more information Here Mark Stanger   Provided document click below link to open that.



http://www.servicenowguru.com/scripting/client-scripts-scripting/move-list-collector-options/



Regards,


Harish.