After successfully setting up the ui-grid-draggable-rows functionality by following the provided instructions, I encountered an error while running the code snippet from the example here.
The error message I received is as follows:
TypeError: this.splice is not a function
This error occurs specifically at this line of code:
this.splice(to, 0, this.splice(from, 1)[0]);
Prior to the splice operation, when I log this
, I get:
console.log(this);
The output displayed is:
app.Tasks
It appears that 'app.Tasks' is being interpreted as a string literal, which may be the reason for the splice
function not functioning as expected. However, this string literal successfully populates the task data in the ui-grid in my Angular controller:
$scope.gridOptions = {
data: 'app.Tasks',
How can I resolve this conflict where the draggable plugin treats the data as a literal string while the grid interprets it as an array of data, especially considering that the example uses hardcoded data?
Update: Here is a snapshot of what 'app.Tasks' looks like in the console:
https://i.sstatic.net/YRLix.png
Update 2: Below is the complete code snippet from the appController:
function appController($scope, $http, $routeParams, uiGridConstants) {
$scope.loading = 1;
$scope.app = null;
$scope.appId = $routeParams.appId;
// Rest of the code snippet goes here...
// (Omitted for brevity)
}