MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / changeInput

Function changeInput

libs/datatables-binding-0.18/datatables.js:833–864  ·  view source on GitHub ↗
(id, value, type, noCrosstalk, opts)

Source from the content-addressed store, hash-verified

831 instance.clearInputs = {};
832
833 var changeInput = function(id, value, type, noCrosstalk, opts) {
834 var event = id;
835 id = el.id + '_' + id;
836 if (type) id = id + ':' + type;
837 // do not update if the new value is the same as old value
838 if (event !== 'cell_edit' && !/_clicked$/.test(event) && shinyData.hasOwnProperty(id) && shinyData[id] === JSON.stringify(value))
839 return;
840 shinyData[id] = JSON.stringify(value);
841 if (HTMLWidgets.shinyMode && Shiny.setInputValue) {
842 Shiny.setInputValue(id, value, opts);
843 if (!instance.clearInputs[id]) instance.clearInputs[id] = function() {
844 Shiny.setInputValue(id, null);
845 }
846 }
847
848 // HACK
849 if (event === "rows_selected" && !noCrosstalk) {
850 if (crosstalkOptions.group) {
851 var keys = crosstalkOptions.key;
852 var selectedKeys = null;
853 if (value) {
854 selectedKeys = [];
855 for (var i = 0; i < value.length; i++) {
856 // The value array's contents use 1-based row numbers, so we must
857 // convert to 0-based before indexing into the keys array.
858 selectedKeys.push(keys[value[i] - 1]);
859 }
860 }
861 instance.ctselectHandle.set(selectedKeys);
862 }
863 }
864 };
865
866 var addOne = function(x) {
867 return x.map(function(i) { return 1 + i; });

Callers 9

applyCrosstalkSelectionFunction · 0.85
datatables.jsFile · 0.85
cleanSelectedValuesFunction · 0.85
updateRowsSelectedFunction · 0.85
updateColsSelectedFunction · 0.85
updateCellsSelectedFunction · 0.85
callbackFunction · 0.85
updateRowInfoFunction · 0.85
updateSearchInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected