Welcome Guest, Not a member yet? Register   Sign In
flexReload Not reloading
#1

[eluser]Richievc[/eluser]
This is for the Flexigrid system

Hi there first must say very nice indeed. My Question or should say problem is that I created a button to hide any line item that has been disable basic 0 disable 1 enabe this value is in Database is_active I use firebug to view the errors.

So everything seems to work, given the problem which is that the data stay the same all disabled users are still there after clicking the disable button.

Code:
if (com=='Hide Disabled') {
        var items = $('.trSelected',grid);
        var itemlist = '';
        for(i=0;i<items.length;i++){
            itemlist+= items[i].id.substr(3)+",";
        }
        $.ajax({
           type: "POST",
           url: "&lt;?=site_url("/ajax/index/hide");?&gt;",
           data: "items=" + itemlist,
           success: function(data){
               $('#flex1').flexReload();
           }
        });
    }


This code send the value hide to trigger the model to hide the uses

Code:
$hide = $this->uri->segment(3);
            
// Build contents query
if($hide=='hide') {
    $this->db->from($table_name)->where('is_active',1);
} else {
    $this->db->from($table_name);
}
$this->flexigrid->build_query();

The Problem seems to be that it's reloading with hide value, then reloading again back to the original value I can see two post in firebug the hide post then a regular post
Code:
url: "&lt;?=site_url("/ajax/index/hide");?&gt;", // first post which it should be
url: "&lt;?=site_url("/ajax/index/");?&gt;", // then back to this one which should not happen
any ideas would help greatly thanks

Thanks
#2

[eluser]Richievc[/eluser]
Ok I got the answer the FlexReload Just reloads teh grid from the original Load The way to do it is to use the following

Code:
success: function(data){
$('#flex1').flexOptions({url:"&lt;?=site_url("/ajax/disable");?&gt;"}).flexReload();
               }

Instead of the reload solo
Hopes this helps anyone else Thanks




Theme © iAndrew 2016 - Forum software by © MyBB