JavaScript pushing record in between when dropping on Kendo Grid

I am trying to use this example as shown HERE in JSFIDDLE, the problem i am having is that I would like when dropping to squeeze the new record in between and not swap. I tried adding a for loop in the drop function that increases the destination record if the target is less than that one or decreases it if the target is more than the destination.

The problem is that I am ending up with repeated positions like 4,4 or 5, 5, 5. Are there any examples of Kendo UI that i can use with this functionality?, instead of swaping?.

example:

id   text      position
1    world        1
2    cup          2
3    Brazil       3
4    2014         4
5    Soccer       5

If i move record 4 to the top i would like to

id   text      position
4    2014         1
1    World        2
2    Cup          3
3    Brazil       4
5    Soccer       5

I would appreciate if anyone could point me in the right direction.

Answer:1

I have created the javascript based demonstration and now I want to hide an image on click in certain condition only. $("#clear").click(function(){ if ($('#image').is(":...

I have created the javascript based demonstration and now I want to hide an image on click in certain condition only. $("#clear").click(function(){ if ($('#image').is(":...

  1. multiple conditions javascript if
  2. multiple conditions javascript
  3. filter multiple conditions javascript
  4. case multiple conditions javascript
  5. ternary multiple conditions javascript
  6. switch multiple conditions javascript
  7. check multiple conditions javascript
  8. multiple conditions in javascript if statement
  9. while multiple conditions javascript
  10. multiple conditions for javascript .includes() method
  11. multiple conditions in javascript for loop
  12. validate multiple conditions javascript
  13. set multiple conditions javascript
  14. add multiple conditions javascript
  15. ternary operator multiple conditions javascript
  16. switch case multiple conditions javascript
  17. if else multiple conditions javascript
  18. array filter multiple conditions javascript
  19. while loop multiple conditions javascript
  20. do while multiple conditions javascript

I really did not want to have to post but I am at my wits end. I have a camera that I will be using to show visitors the current weather conditions. I have a powershell script saving snapshots from ...

I really did not want to have to post but I am at my wits end. I have a camera that I will be using to show visitors the current weather conditions. I have a powershell script saving snapshots from ...

I am using the following code to allow line breaks in the JQuery UI tooltip function. $(function() { $( document ).tooltip(); $('.linebreak').tooltip({ content: function(callback) {...

I am using the following code to allow line breaks in the JQuery UI tooltip function. $(function() { $( document ).tooltip(); $('.linebreak').tooltip({ content: function(callback) {...

  1. .replace only replacing first instance
  2. .replace only replacing first instance javascript
  3. jquery replace only replacing first instance
  4. js replace only replacing first instance
  5. javascript replace only replacing first occurrence
  6. javascript replace only replacing first value

In my Angular app the following sequence of events needs to happen: User clicks a button A previously hidden div is shown by flipping a boolean scope variable to which an ng-show is bound The newly ...

In my Angular app the following sequence of events needs to happen: User clicks a button A previously hidden div is shown by flipping a boolean scope variable to which an ng-show is bound The newly ...