Welcome Guest, Not a member yet? Register   Sign In
Flashdata: Accessing flash:new vs flash:old
#1

[eluser]sethkain[/eluser]
I am using flashdata to keep track of how columns in my table are being sorted.
But when I switch from one table column to another there is a delay in them sorting correctly.
I think it is because of flash:new vs flash:old.
The first time I click on Company I get:

[flash:new:Company] => desc

The second time I get:

[flash:old:Company] => desc
[flash:new:Company] => asc

Then if I click on Contract Num I get:

[flash:old:Company] => asc
[flash:new:Contract Num] => desc

I need to be able to access the flash:new variable when I call:cotr_contract_list_sort($sort_field)
$sort_field is a table column name. (ex. Company Name, Contract Num, etc.)
Code:
public function cotr_contract_list_sort($sort_field){
            $CI =& get_instance();
            
            //Get FlashData
            $order=$CI->session->userdata($sort_field);
            
            //Show Sort Icon
            if(isset($order)){
                if($order=='asc'){
                    echo "<img src='".image_url()."/arrow_down.png' id='sort_image'>";
                }elseif($order=='desc'){
                    echo "<img src='".image_url()."/arrow_up.png' id='sort_image'>";
                }
            }
         }

Thanks In Advance!
#2

[eluser]Aken[/eluser]
Flashdata is retrieved using session->flashdata(), not session->userdata(). And you don't show how you're setting the column or how this function is being called.




Theme © iAndrew 2016 - Forum software by © MyBB