column-sortable icon indicating copy to clipboard operation
column-sortable copied to clipboard

Added @sortableurl

Open fomvasss opened this issue 5 years ago • 5 comments

Often there is a need to get a URL for sorting, for example in select or button, for example:

<select class='ajax-sortable'>
      <option value='@sortableurl('id')'>
      <option value='@sortableurl('name')'>
</select>

I added sortableurl function and blade directive. Please, accept my pull-requeat. Thanks!

fomvasss avatar Jan 21 '19 23:01 fomvasss

Hey @fomvasss,

Do I understand the why of this PR.

The sorting does not happen using links <a> but rather via select-box? I've seen this kind of approach. Just making sure.

Kyslik avatar Jan 26 '19 08:01 Kyslik

I need to get only URL for sortable, without tag <a>

fomvasss avatar Jan 26 '19 12:01 fomvasss

@Kyslik , why this PR isn't accepted? I also need functions in this PR. Perhaps @fomvasss needs the @sortableurl in the case like this.

<select class='ajax-sortable'>
    <option value='@sortableurl('id')'>
    <option value='@sortableurl('name')'>
</select>

<script>
    $(".ajax-sortable").on("change", function(){
        $.ajax({
            url:$(this).val(),
            type:'POST',
            data:{
                'user_id':$('#user_id').val(),
                'user_name':$('#user_name').val()
            }
        }).done((data) => {
            $('.result').html(data);
        })
    })
</script>

nomura-axis avatar May 29 '19 10:05 nomura-axis

@nomura-axis Because I did not have time to vet it.

Kyslik avatar May 30 '19 19:05 Kyslik

@fomvasss, @nomura-axis do you think you could add tests for this; I will happily vet & merge.

Kyslik avatar Sep 07 '19 10:09 Kyslik