column-sortable
column-sortable copied to clipboard
Added @sortableurl
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!
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.
I need to get only URL for sortable, without tag <a>
@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 Because I did not have time to vet it.
@fomvasss, @nomura-axis do you think you could add tests for this; I will happily vet & merge.