Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/455.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript nestedSortable当它成为子项时添加类_Javascript_Jquery_Nested Sortable - Fatal编程技术网

Javascript nestedSortable当它成为子项时添加类

Javascript nestedSortable当它成为子项时添加类,javascript,jquery,nested-sortable,Javascript,Jquery,Nested Sortable,因此,如果你一直试图在“li”中添加一个类,当它是一个子项时 我试图添加的类是mjs nestedSortable no nesting,因此子项中不能有子项 <ol class="sortable ui-sortable mjs-nestedSortable-branch mjs-nestedSortable-expanded"> <li style="display: list-item;" class="mjs-

因此,如果你一直试图在“li”中添加一个类,当它是一个子项时

我试图添加的类是mjs nestedSortable no nesting,因此子项中不能有子项

              <ol class="sortable ui-sortable mjs-nestedSortable-branch mjs-nestedSortable-expanded">
                <li style="display: list-item;" class="mjs-nestedSortable-leaf" id="menuItem_<?=$row['MAINCATID']; ?>">
                      <div class="menuDiv">
                        <span>
                          <span data-id="<?=$row['MAINCATID']; ?>" class="itemTitle"><input type="text" class="form-control vasteWidth inputNamen" value="<?=$row['MAINCATNAAM']; ?>"></span>
                          <span title="Click to delete item." data-id="<?=$row['MAINCATID']; ?>" class="deleteMenu pull-right fa fa-times-circle fa-3x"></span>
                        </span>
                      </div>
                      <ol>
                          <li style="display: list-item;" class="mjs-nestedSortable-no-nesting" id="menuItem_<?=$s['MAINCATID']; ?>">
                            <div class="menuDiv">
                              <span>
                                <span data-id="<?=$s['SUBCATID']; ?>" class="itemTitle"><input type="text" class="form-control vasteWidth inputNamen" value="<?=$s['SUBCATNAAM']; ?>"></span>
                                <span title="Click to delete item." data-id="<?=$s['SUBCATID']; ?>" class="deleteMenu pull-right fa fa-times-circle fa-3x"></span>
                              </span>
                            </div>
                          </li>
                      </ol>
                  </li>
              </ol>


你能提供你写的代码吗?Hello Nir,我添加了我使用的html代码(如果它是子类或非子类的话,大部分php内容都没有排序)。对于javascript,我几乎使用默认代码,我知道我需要使用更新事件添加类,但我不知道从哪里开始。