Welcome Guest, Not a member yet? Register   Sign In
Flexigrid - Lightweight but rich data grid

[eluser]paky[/eluser]
Hi can I insert a img tag in flexigrid ? I've a folder with jpeg files ...

thanks Smile

P.S.
I found a solution Tongue (here the code)
Code:
while ($row = mysql_fetch_array($result)) {
$user_photo=(file_exists(PHOTO_FILE_PATH.$row['ute_id'].'_first.jpg'))?PHOTO_FILE_PATH.$row['ute_id'].'_first.jpg':PHOTO_FILE_PATH.'default.jpg';
if ($rc) $json .= ",";
$json .= "\n{";
$json .= "id:'".$row['ute_id']."',";
$json .= "cell:[";
//$json .= "'".$row['ute_id']."'";
$json .= "'".addslashes('<img src="'.$user_photo.'" width="30" height="30">')."'";  //<---------- line solution ...
$json .= ",'".$row['ute_cognome'].' '.$row['ute_nome']."'";
$json .= ",'".addslashes($row['bar_nome'])."'";
$json .= ",'".addslashes($row['bar_cabine'])."'";

[eluser]somemilk[/eluser]
Hi, thanks for the great plugin.
Sorry for my ignorance, but i can't figure how to reload the grid. All examples i saw here so far are implementing edit/delete rows in just alerting selected rows way, but if i really delete some rows, i must reload the grid after successful ajax call, how do i do that? how do i access the properties of the created grid?

[eluser]Kevin Kietel[/eluser]
[quote author="somemilk" date="1210091001"]Hi, thanks for the great plugin.
Sorry for my ignorance, but i can't figure how to reload the grid. All examples i saw here so far are implementing edit/delete rows in just alerting selected rows way, but if i really delete some rows, i must reload the grid after successful ajax call, how do i do that? how do i access the properties of the created grid?[/quote]

Hi,

try this: $("#flex1").flexReload();

Code:
function test(com,grid)
{
    if (com=='Delete')
        {
           if($('.trSelected',grid).length>0){
           if(confirm('Delete ' + $('.trSelected',grid).length + ' items?')){
            var items = $('.trSelected',grid);
            var itemlist ='';
            for(i=0;i<items.length;i++){
                itemlist+= items[i].id.substr(3)+",";
            }
            $.ajax({
               type: "POST",
               dataType: "json",
               url: "delete.php",
               data: "items="+itemlist,
               success: function(data){
                   alert("Query: "+data.query+" - Total affected rows: "+data.total);
               $("#flex1").flexReload();
               }
             });
            }
            } else {
                return false;
            }
        }
    else if (com=='Add')
        {
            alert('Add New Item Action');
          
        }            
}

You can see it working on my example at:

http://www.sanderkorvemaker.nl/test/flexigrid/

Let me know if it's working!

Sander

[eluser]somemilk[/eluser]
Hi.
[quote author="Kevin Kietel" date="1210091273"]

try this: $("#flex1").flexReload();

You can see it working on my example at:

http://www.sanderkorvemaker.nl/test/flexigrid/

Let me know if it's working!

Sander[/quote]

Thanks.
Unfortunately it doesn't work for me for IE6, first i tried this on FF and it worked just fine, and then tested on IE - it just outputs the first confirm "Delete N items?" and then nothing, no JS errors, no alerts, no reload. The flexReload() in my code works fine on FF but on IE6 it tries to reload but reloaded grid is empty Sad

[eluser]Kevin Kietel[/eluser]
[quote author="somemilk" date="1210092102"]Hi.
[quote author="Kevin Kietel" date="1210091273"]

try this: $("#flex1").flexReload();

You can see it working on my example at:

http://www.sanderkorvemaker.nl/test/flexigrid/

Let me know if it's working!

Sander[/quote]

Thanks.
Unfortunately it doesn't work for me for IE6, first i tried this on FF and it worked just fine, and then tested on IE - it just outputs the first confirm "Delete N items?" and then nothing, no JS errors, no alerts, no reload. The flexReload() in my code works fine on FF but on IE6 it tries to reload but reloaded grid is empty Sad[/quote]

Hmmm... that's strange, when I try my own example in IE6, it works just fine. When I select one or more items, and press Delete, I get a confrim "Delete 2 items" and then the delete function is triggered to delete those items. After that the flexigrid is reloaded.

Can you send me the URL to your version? I might take a look for you!

Thanks,
Kevin

[eluser]somemilk[/eluser]
[quote author="Kevin Kietel" date="1210092881"]

Hmmm... that's strange, when I try my own example in IE6, it works just fine. When I select one or more items, and press Delete, I get a confrim "Delete 2 items" and then the delete function is triggered to delete those items. After that the flexigrid is reloaded.

Can you send me the URL to your version? I might take a look for you![/quote]

It's somewhat deep in the devel site but I'll make a copy in my sandbox, please wait for some time.

[eluser]Kevin Kietel[/eluser]
[quote author="somemilk" date="1210094156"][quote author="Kevin Kietel" date="1210092881"]

Hmmm... that's strange, when I try my own example in IE6, it works just fine. When I select one or more items, and press Delete, I get a confrim "Delete 2 items" and then the delete function is triggered to delete those items. After that the flexigrid is reloaded.

Can you send me the URL to your version? I might take a look for you![/quote]

It's somewhat deep in the devel site but I'll make a copy in my sandbox, please wait for some time.[/quote]

If you want, you can PM me the URL Smile

[eluser]somemilk[/eluser]
[quote author="Kevin Kietel" date="1210094210"]
If you want, you can PM me the URL Smile[/quote]
It's not that simple in my case Smile
Anyway, i've made a test script here http://somemilk.org/flexitest/
But it's very strange, it works fine in both FF and IE while your example still doesn't work Smile So i guess it's my fault somewhere in my code and i'll look for it, but your code doesn't work for me either. I'll tell you the exact conditions which may help to reproduce this.

1. opening your URL http://www.sanderkorvemaker.nl/test/flexigrid/ with MSIE 6.0
2. clicking on afghanistan, albania, algeria
3. clicking on "delete". "Delete 3 items?" confirm box appears
4. clicking OK, nothing happens

This is a stable behavior because our tester noticed that independently from me, he has MSIE6 too.

[eluser]Kevin Kietel[/eluser]
[quote author="somemilk" date="1210096830"][quote author="Kevin Kietel" date="1210094210"]
If you want, you can PM me the URL Smile[/quote]
It's not that simple in my case Smile
Anyway, i've made a test script here http://somemilk.org/flexitest/
But it's very strange, it works fine in both FF and IE while your example still doesn't work Smile So i guess it's my fault somewhere in my code and i'll look for it, but your code doesn't work for me either. I'll tell you the exact conditions which may help to reproduce this.

1. opening your URL http://www.sanderkorvemaker.nl/test/flexigrid/ with MSIE 6.0
2. clicking on afghanistan, albania, algeria
3. clicking on "delete". "Delete 3 items?" confirm box appears
4. clicking OK, nothing happens

This is a stable behavior because our tester noticed that independently from me, he has MSIE6 too.[/quote]

In my example I've added the functionality to delete selected items. The actual delete action is disabled in the php page, to prevent data loss Wink

[eluser]somemilk[/eluser]
[quote author="Kevin Kietel" date="1210097206"]
In my example I've added the functionality to delete selected items. The actual delete action is disabled in the php page, to prevent data loss Wink[/quote]

Well I mean that in FF i got the message with SQL and grid reload. In MSIE I got no message and no reload. In both browsers there are no data loss of course but in the first one grid is reloaded and in second it isn't Smile




Theme © iAndrew 2016 - Forum software by © MyBB