Code Monkey home page Code Monkey logo

bootstrap-jquery-plugin's People

Contributors

cbschuld avatar newghost avatar redexp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootstrap-jquery-plugin's Issues

Handling Multiple Dialogs

So far this has been fixed in bootstrap #4781 and #14927

For some reason wasn't working with this plugin and I had to trick it based on this

var close = function(destroy) {...
// add modal open class since we still have opened modal.
if ($('.modal').length) {
$('body').addClass('modal-open');
}

I'll leave this here to see if this could be enhanced or just to anyone else that could have the same problem as I did.

confirm框,callback回调我觉得应该有一个bug

点击确定,执行回调应该放在 hidden.bs.modal 隐藏动作完成触发事件中,如:
$msgbox.modal('hide').one('hidden.bs.modal', function() {
if (destroy) {
$this.data(parentDataName).append($this);
$msgbox.remove();
//bug fix by su.wenrong
callback && callback();
}
});
因为之前的写法,由于bootStrap modal隐藏动作是异步为隐藏滚动条做了些body padding-right 的调整工作,而隐藏动作完成后需调整回正常状态,callback 需要在确保完成隐藏动作完成后(调整回正常状态)才执行,这样就不会冲突出现:冲突场景 在callback 里面又有打开另一个modal时,就会出现调整冲突,之前的调整还未结束,出现新的modal框就出现调整错误,导致body padding-right 多出多余的px。

Can't set buttons through dialog API's options

It seems that you cannot alter/set the buttons for a dialog after it has been created. This is supported by the default JQuery UI API for dialogs, as documented below.

http://api.jqueryui.com/dialog/#option-buttons

This is what one such call would look like:

$( ".selector" ).dialog( "option", "buttons", [ { text: "Ok", click: function() { $( this ).dialog( "close" ); } } ] );

Your current code only allows you to define that button at dialog creation time.

Extra buttons in dialogs

There seems to be an issue with extra buttons in a dialog. The problem happens when you add a function to the array prototype, the name of the new function appears as a new button in the dialog.

Array.prototype.whatever = function() {};

$("#dialog").dialog({
buttons: [
{ text: "1" },
{ text: "2" }
]
});

Looking at the code the problem seems to be related to lines 69 and 70(I believe):
"for (var button in buttons) {
var btnObj = buttons[button]".

Replacing the lines above with the ones below should take care of the problem
"for (var i=0, x=buttons.length;i<x; i++) {
var btnObj = buttons[i]"

Fetching dialog's current buttons actually erases them

You should be able to request the current button definitions for a dialog so that they can be altered and then re-assigned. Instead, when you request the current definitions they get erased.

Fetching:

var buttons = $('#SomeID').dialog('option', 'buttons');

This causes the current buttons to get erased, not to get returned.

If it worked, you would then be able to alter the buttons array and then re-assign it back:

buttons.push({text: 'new button text', id: 'new-id', click: function() { alert('Works'); }});
$('#SomeID').dialog('option', 'buttons', buttons);

I believe the problem in your code is this:

if (options == "option") {
    arguments[1] == 'buttons' && createButton({ buttons: arguments[2] });
    show();
}

It calls createButton() even if you don't pass an object for assignment. You need to check for the presence of arguments[2] and if not there, merely return the current button definitions.

datgrid模块edit模式修改input的value后getData并不能总是获得合适的rows

如题。

重现:
官网网站的演示文档为例,在各行Number列的input框内输入aaaaaaaa覆盖原来的sum值,点击
执行run('#getData')按钮,得到的是

[{"name":"item12","type":"Free","sum":143400},{"name":"item13","type":"Free","sum":3426919},{"name":"item14","type":"Free","sum":3343312},{"name":"item15","type":"Free","sum":120330},{"name":"item16","type":"Not Free","sum":319492},{"name":"item31","type":"Not Free","sum":321338},{"name":"item13","type":"Unknow","sum":342219},{"name":"item54","type":"Unknow","sum":231000},{"name":"item36","type":"Unknow","sum":259451},{"name":"item34","type":"Unknow","sum":449563}]

相应的sum值并没有变成aaaaaaaa

Buttons don't work

After several tries, you can click the buttons in the modal and the modal doesn't close.

autoOpen: false ignored

It appears that your plugin ignores the "autoOpen: false" option when creating a dialog.

It seems that as soon as I add your plugin to the mix, my dialogs all open up right away on page load.

I tested it with a bare page and a single plain dialog and saw that was still the case.

The rest of the functionality seems quite nice, though. Totally painless to get Bootstrap dialogs, which is a big help since I'm converting a legacy JQuery UI app.

Thanks.

Dialog API only supports arrays of buttons, not objects

There should be two methods for defining buttons in a dialog, arrays and objects. Your dialog code appears to support only arrays. I've been unable to get any of my existing dialogs that used objects to work.

Objects (not currently supported):

buttons: {
        'Reset password': function () {
            $(this).dialog('close');
            form.submit();
        },
        'Cancel': function () {
            $(this).dialog('close');
        }
}

Arrays (currently supported):

buttons: [
        {
            text: 'Cancel',
            click: function () {
                $(this).dialog('close');
            }
        },
        {
            text: 'Reset password',
            click: function () {
                $(this).dialog('close');
                form.submit();
            }
        }
]

Still super glad I came across your plugin, though. Has made moving to Bootstrap much easier. Thanks.

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.