vitalets / x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
http://vitalets.github.io/x-editable
MIT License
6.51k stars 1.72k forks source link

Change dynamic status by dropdown #1064

Open robertnicjoo opened 6 years ago

robertnicjoo commented 6 years ago

Hi,

I'm working on laravel 5.5 and I have my statuses table, I would like to change my entries status using xeditable.

If my status was static 0 and 1 I know how to do that but my problem is that I don't know how to edit dynamic data.

I shared same question on stackoverflow here is the link

I will repeat my question here in case someone would like to help here:

I have select button where i choose status for my entries and this status comes from statuses table and it's not a column is each table (it's general option) so what I want to do is to change status_id column in my tables with help of x-editable but i don't know how to get my dynamic data in JavaScript.

Here is my current form to show statuses in index page of my reviews for example:

<form action="{{route('updatebyajax', $rating->id)}}" method="post">
  {{csrf_field()}}
  <td class="text-center" style="width:100px;">
    <select class="form-control status" name="status_id">
      @foreach($statuses as $status)
          <option id="rating" class="rating" data-url="{{ route('updateratebyajax', $rating->id) }}" data-pk="{{ $rating->id }}" data-type="select" data-placement="right" data-title="Edit Rate" value="{{$status->id}}">{{$status->title}}</option>
      @endforeach
    </select>
  </td>
</form>

So what I need is basically get info out of statuses table and change by select.

wbptn

Thanks in advance.