JavaScript Restrict drag-and-droppable rows in HTML5

I am trying to implement drag and drop rows with in same table using html5, but I would like to restrict the drop area to few rows instead of whole table.

Code :

<table id="visibletable" class="dra-table">
                    <thead>
                        <tr>
                            <th>Visible</th>
                            <th>Width</th>
                            <th>Color</th>
                        </tr>
                    </thead>
                    <tbody ondrop="dropPart(event)" ondragover="allowDropPart(event)">
                        <tr>
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                        </tr>
                        <tr id="partdesc1"  draggable="true" ondragstart="dragPart(event)">
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                        </tr>
                        <tr id="partdesc2"  draggable="true" ondragstart="dragPart(event)">
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                        </tr>
                        <tr id="partdesc3"  draggable="true" ondragstart="dragPart(event)">
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                        </tr>
                        <tr id="partdesc4"  draggable="true" ondragstart="dragPart(event)">
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                        </tr>
                        <tr id="partdesc5"  draggable="true" ondragstart="dragPart(event)">
                            <td>1</td>
                            <td>2</td>
                            <td>3</td>
                        </tr>
                    </tbody>
                </table>

First 3 rows in the table are not be allowed to drag and draggable rows should not be allowed to drop with in first 3 rows.

Currently I am have applied ondrop="dropPart(event)" at the tbody tag so I am able to drop rows any where in the table, Is there a way to restrict drop area?

Answer:1

due to CRM 2011 online problems with IE10, we have decided to convert all front-end JavaScript from Soap to oData. Everything was going fine, I installed the oData designer, centralized the queries in ...

due to CRM 2011 online problems with IE10, we have decided to convert all front-end JavaScript from Soap to oData. Everything was going fine, I installed the oData designer, centralized the queries in ...

I have created a Button in Bootstrap and assigning an attribute to it. Upon clicking the button, I wish to get the attribute value in the function. However, when I pass $element.currentTarget to ...

I have created a Button in Bootstrap and assigning an attribute to it. Upon clicking the button, I wish to get the attribute value in the function. However, when I pass $element.currentTarget to ...

  1. button attributes bootstrap

I have this code and I cannot get the second time to format properly: setInterval(function() { var local = new Date(); var localdatetime = local.getHours() + ":" + local.getMinutes() + ":" +...

I have this code and I cannot get the second time to format properly: setInterval(function() { var local = new Date(); var localdatetime = local.getHours() + ":" + local.getMinutes() + ":" +...

  1. format javascript date object
  2. format javascript date string
  3. format javascript date time
  4. format javascript date mm/dd/yyyy
  5. format javascript date output
  6. format javascript date yyyy-mm-dd
  7. format javascript date iso 8601
  8. format javascript date dd/mm/yyyy
  9. format javascript date with moment
  10. format javascript date.now
  11. javascript format date with timezone
  12. javascript format date locale
  13. javascript format date from timestamp
  14. javascript format date time string
  15. javascript format date iso
  16. javascript format date function
  17. javascript format date month name
  18. javascript format date utc
  19. javascript format date dd mmm yyyy
  20. javascript format date without time

(Note: I asked this question on https://github.com/gkz/LiveScript/issues/731 as well) When I use LiveScript in an html file directly, I have no way to run livescript code immediately on seen. For ...

(Note: I asked this question on https://github.com/gkz/LiveScript/issues/731 as well) When I use LiveScript in an html file directly, I have no way to run livescript code immediately on seen. For ...