volosoft / jtable

A JQuery plugin to create AJAX based CRUD tables.
http://www.jtable.org
1.09k stars 506 forks source link

UpdateAction Refresh #1661

Open denhsieh opened 9 years ago

denhsieh commented 9 years ago

After both create and update actions on server side I return this, but only the create action parses HTML into the cells and makes the anchor link, the update doesn't and strips the html down to raw text. Can someone advise why I can't get HTML after an update action?

$row['FileName'] = '<h3><a href="downloadFile.php?tablename=tbltraining_user_file&id='.$row['FileID'].'">'.$row['FileName'].'</a></h3>';
denhsieh commented 9 years ago

I kludged a fix by reloading the table on recordUpdated action, but I'm still curious why it doesn't parse the HTML after an updateAction?

sheryever commented 9 years ago

Use display function to set these kind of links

MyLink: {
    create: false,
    edit: false, 
    display: funciton (data){
        var r = data.record;

        return '<h3><a href="downloadFile.php?tablename=tbltraining_user_file&id=' + r.FileID +'">'+r.FileName +'</a></h3>';

    }
baybird commented 9 years ago

But this doesn't work, just tried.

return '';

baybird commented 9 years ago

return '< img src="' + data.record.img + '" border=0 width="58" />';

sheryever commented 9 years ago

@baybird try this

console.log(data.record.img);
return '< img src="' + data.record.img + '" border="0" width="58" />';

check in the chrome Developer Toolbar, what you have in your img property and post code or you field all options

baybird commented 9 years ago

I had got it works. Thanks anyway.