Code Monkey home page Code Monkey logo

yii2-sortable-widgets's Issues

checkbox states when sorting rows

Hello. Thank you for maintaining your plugin. I use it on my site in a few places and very useful.

I have an issue that I can't figure out. I have a Gridview widget that contains checkboxes in each row like:

'value' => function ($model, $key, $index, $grid) { $mid = $model->_id.'_'.$model->key; $chkbox = "<input id='{$mid}' class='selections' type='checkbox' name='selections[]' value='{$mid}'>"; return $chkbox; },

The strange behavior can be reproduced by:

  1. selecting row checkboxes
  2. de-select them
  3. drag a few to re-order
  4. result: the de-selected checkboxes will be selected again

It's kind of strange, but I'm not sure how to approach a fix. I tried to reproduce it on other jQuery based drag-sort examples, but can't reproduce. Do you have any ideas?

Thank you!

Не заработало

Привет!
подскажи плиз в чем может быть проблема
Добавил все как написано, но почему то не хочет работать
В чем может быть проблема?

Ошибка при использовании виджета

Доброго времени суток. при использовании Вашего виджета возникла проблема. Она не загружает скрипт Sortable.min.js.
Ошибки консоли

GET http://localhosti/admin/assets/8fa63dbc/Sortable.min.js net::ERR_ABORTED 404 (Not Found)
jquery.js:4055 Uncaught ReferenceError: Sortable is not defined
at HTMLTableSectionElement. (jquery.binding.js:37)
at Function.each (jquery.js:381)
at jQuery.fn.init.each (jquery.js:203)
at jQuery.fn.init.$.fn.sortableWidgets (jquery.binding.js:32)
at initSortableWidgets (sortable-widgets.js:2)
at HTMLDocument. (article:568)
at mightThrow (jquery.js:3762)
at process (jquery.js:3830)

Wrong sort when enabled pagination

С пагинацией криво сортирует, так и задумано, что виджет можно использовать только без пагинации?

After save: position has wrong value

Sorry, but I found another bug.

in behavior->beforeInsert the first value is 1 for the order column.

I had this in my grid (like 1, 2, 3, 4, 5), but after saving it was 0,1,2,3,4.
Could you reproduce this? I think it is because of this line:
$model->{$this->orderAttribute} = $order;
$order is the key, beginning with 0.

Very strange, btw: in a grid w/o sorting, the data-key value of an tr is the id of the model, like here:
tr-ok
In a sortable grid it is like this:
tr-sortable
so data-sortable-id is the id of the model and data-key is the order column, I think?

composer

Hello, how can I install this widget?

sortable within on "parent"

Hi,

i have one table having many rows which are "grouped" or "filtered" by a parent. I would love to use your extension, but I don't know how to make your extension with something like a "scope" - do you have an idea, how to manage this?

Thanks Philipp

way to make order field always start from zero vs. increment from highest order record

I wanted new records to be indexed by other owners (like "group_id") to always start from 0 instead of [$this->owner->{$this->orderAttribute} = $last->{$this->orderAttribute} + 1;]. I found that if I removed the public function behaviors(){...} from my MODEL and it prevented this behavior because it bypasses the beforeInsert() in the Sortable class. Just thought I'd share. Nice widget though.

So it looks like this:
id,group_id,order

  • 1,1,0
  • 2,1,1
  • 3,1,2
  • 4,1,3
  • 5,2,0
  • 6,2,1
  • 7,2,2
  • 8,2,3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.