Giter Site home page Giter Site logo

Comments (12)

jeffdupont avatar jeffdupont commented on August 19, 2024

I'll have a look. The rerender shouldn't be drawing another toolbar and
header.
As for the loading event, what you should do it initialize the table
separately and then in the triggered show event for the modal you can
access the DT element, add whatever parameters you want and call the render
then.
On May 4, 2013 1:25 AM, "nude" [email protected] wrote:

i've add some new tool on the toolbar and it call the modal on the view
page where the plugin is call. how can i rerender this table after i have
ajax call? i've been doin this one

function _initDeleteModal() {
var o = this.options
, $e = this.$element
, $toggle = $("")
, that = this

// render the display modal button
$toggle
.addClass("btn")
.data("toggle", "modal")
.attr("href", "#")
.attr("title", "Delete a row.")
.html("<i class="icon-trash">")
.click(function() {
var numItems = $('.info').length;
if(numItems > 0){
if($(o.deleteModal).hasClass("modal"))
$(o.deleteModal)
.modal();
else if($(o.deleteModal).is(":visible"))
$(o.deleteModal)
.hide();
else
$(o.deleteModal)
.show();
}
$('#btn-delete')
.click(function(evt) {
that.loading( true );
that.render(); // how can i get this function run only once
that.loading(false);
})
return false;
})

this.buttons.unshift($toggle);

}

it only work good on the first call of onclick function.. but in the
second times i call onClick i got the table rendered the toolbar twice and
the pagination bar twice and more


Reply to this email directly or view it on GitHubhttps://github.com//issues/11
.

from bootstrap-data-table.

jimmydumalang avatar jimmydumalang commented on August 19, 2024

what you mean about initialize the table separately? it means i should create a function like render or loading or remove.. etc? thx for reply..

from bootstrap-data-table.

jeffdupont avatar jeffdupont commented on August 19, 2024

If you're using the datatable in the modal, you can initialize it when the
page loads, and then tell it to render only on the show event for the modal.
On May 4, 2013 10:01 AM, "nude" [email protected] wrote:

what you mean about initialize the table separately? it means i have
create a function like render or loading or remove.. etc? thx for reply..


Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-17437534
.

from bootstrap-data-table.

jimmydumalang avatar jimmydumalang commented on August 19, 2024

all i need is rerender the toolbar and the pagination bar without create the new one.
i did create the function call "rerender" without initialize the toolbar and the pagination. but it's going to delete the toolbar after ajax call.

$(document).ready(function(){

// Delete a row 
$('#btn-delete').bind('click', function(e) {
    $.ajax({
        type: "POST",
        url: '<?php echo site_url("admin/master_category/doDelete")?>',// Redirect to doDelete
        data: { 
            'row_id': $('#delete-id').val()
        },
        dataType: "json",
        success: function(data){
                    if(data['msg'] == "1"){
                        // i have to rerender the table here.. 
                    }else{

                    }
                 }
     });
});
// End of delete a row

});

i have two function by click event, the first one is on the plugin, the second is on my php code.

i still don't get the point.. i have to go deeper for the concept of jquery. i'm sorry jeff.. thank u so much for the reply

from bootstrap-data-table.

jeffdupont avatar jeffdupont commented on August 19, 2024

Ah, yeah. It actually does that because of the way it populates the
pagination and info. I had created it that way for the company I had
originally wrote it for. It shouldnt be doubling the toolbar and headers
though. I'll see if I can get this looked at soon.
On May 4, 2013 10:48 AM, "nude" [email protected] wrote:

all i need is rerender the toolbar and the pagination bar without create
the new one.
i did create the function call "rerender" without initialize the toolbar
and the pagination. but it's going to delete the toolbar after ajax call.

$(document).ready(function(){

// Delete a row
$('#btn-delete').bind('click', function(e) {
$.ajax({
type: "POST",
url: '',// Redirect to doDelete
data: {
'row_id': $('#delete-id').val()
},
dataType: "json",
success: function(data){
if(data['msg'] == "1"){
// i have to rerender the table here..
}else{

                }
             }
 });

});
// End of delete a row

});

i have two function by click event, the first one is on the plugin, the
second is on my php code.

i still don't get the point.. i have to go deeper for the concept of
jquery. i'm sorry jeff.. thank u so much for the reply


Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-17438259
.

from bootstrap-data-table.

jimmydumalang avatar jimmydumalang commented on August 19, 2024

i try to use remove the table and render the table again but it still happen. i still don't know what's going on

from bootstrap-data-table.

jeffdupont avatar jeffdupont commented on August 19, 2024

I had some pending updates that I've just applied to the repository. Some had to do with a similar problem you had, so if you can update your code with the latest source and let me know if that seemed to fix the issue. Thanks.

from bootstrap-data-table.

jimmydumalang avatar jimmydumalang commented on August 19, 2024

i've update my code jeff.. but i still get this result. the toolbar increase as much i did do the delete statement

screen shot 2013-05-08 at 7 53 55 am

screen shot 2013-05-08 at 7 54 12 am

screen shot 2013-05-08 at 7 55 01 am

from bootstrap-data-table.

jeffdupont avatar jeffdupont commented on August 19, 2024

you're going to need to post a gist for me on this so I can see your code
and try to replicate it. I'm really not sure why you're getting this issue.

On Tue, May 7, 2013 at 6:01 PM, jimmydumalang [email protected]:

i've update my code jeff.. but i still get this result. the toolbar
increase as much i did do the delete statement

[image: screen shot 2013-05-08 at 7 53 55 am]https://f.cloud.github.com/assets/4338188/475011/22a68e24-b77a-11e2-8210-231174bb4fcc.png

[image: screen shot 2013-05-08 at 7 54 12 am]https://f.cloud.github.com/assets/4338188/475016/341e682a-b77a-11e2-9651-034bbaf80e39.png

[image: screen shot 2013-05-08 at 7 55 01 am]https://f.cloud.github.com/assets/4338188/475020/89bed31e-b77a-11e2-8db0-9aa7cc76cb8a.png


Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-17580646
.

Jeff Dupont

from bootstrap-data-table.

jimmydumalang avatar jimmydumalang commented on August 19, 2024

sorry jeff i'm new using github. you mean like this?

https://gist.github.com/jimmydumalang/5546631

https://gist.github.com/jimmydumalang/5546643

did you see my screenshot? if you see on network, you can see that in the first picture the ajax only called once,

in the second picture the ajax called twice, and the third picture called three times. i think that's why the table rendered multiple times.

from bootstrap-data-table.

jimmydumalang avatar jimmydumalang commented on August 19, 2024

hello jeff i've found the solution of my issue

i'm using this one on success of my ajax

$("#table-container_1").datatable('render');

thx for your help.. you can close this issue.. thanks..

from bootstrap-data-table.

jeffdupont avatar jeffdupont commented on August 19, 2024

Thanks for letting me know that it is working properly

from bootstrap-data-table.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.