Jump to content


Robert

Member Since 03 Jun 2013
Offline Last Active Jan 26 2015 06:42 AM
-----

Topics I've Started

Chosen dropdown update

20 January 2015 - 03:01 PM

I have created a ajax script to add records to DB and now want to update the chosen dropdown to see the records without refreshing the page ..

 

I have 

<script type="text/javascript">
$(document).ready(function(){
    $("#sky-inchidere").submit(function(e){     
        e.preventDefault();

        var tdata= $("#sky-inchidere").serializeArray();
        $.ajax({
            type: "POST",
            url: 'http://localhost/new/oportunitati/add',
            data: tdata, 

            success:function(tdata)
            {
                // close the modal
                $('#myModal').modal('hide');

                // update dropdown ??
                $('.chosen-select').trigger('liszt:updated');
            },
            error: function (XHR, status, response) {
               alert('fail');
            }
        });
    });
});
</script>

I have tried :

$('.chosen-select').trigger('liszt:updated');
$('#field-beneficiar_p').trigger('chosen:updated');
$('field-beneficiar_p').trigger('liszt:updated');

The field name is :

<select id='field-sectiune_p' name='sectiune_p' class='chosen-select' data-placeholder='Selecteaza Categorie'>

any suggestions ? 


Chosen dropdown update

20 January 2015 - 03:00 PM

Duplicate plz delete


callback column + array

31 July 2014 - 06:19 AM

I want to pass in a column data from a array
 
// callback column
public function _callback_test($value, $row) {

// array with the info
$test= $this->Misc->getDen($row->id,'aaaa','bbbb','1');

foreach ($test as $key => $value) {
      return $value->xxxx;
}
}
 
the array $test has 4 records but i only see 1 in the view. Any info how can i pass to the column all the array ? Sry for the multipost - i hade a net problem.

 


callback_column with array

30 July 2014 - 02:18 PM

I want to pass in a column more data then 1 row.

// callback column
public function _callback_test($value, $row) {
$test= $this->Misc->getDen($row->id,'aaaa','bbbb','1');
     foreach ($test as $key => $value) {
           return $value->xxxx;
    }
}

the array $test has 4 records but i only see 1 in the view. Any info how can i pass to the column all the array ?

 


callback_column with array

30 July 2014 - 02:08 PM

I want to pass in a column more data then 1 row.

// callback column
public function _callback_test($value, $row) {
$test= $this->Misc->getDen($row->id,'aaaa','bbbb','1');
     foreach ($test as $key => $value) {
           return $value->xxxx;
    }
}

the array $test has 4 records but i only see 1 in the view. Any info how can i pass to the column all the array ?