vtfuture / BForms

Bootstrap Forms for ASP.NET MVC
MIT License
62 stars 33 forks source link

Additional Controls in Inline Question #276

Open meister-d opened 8 years ago

meister-d commented 8 years ago

Hi BForms Team I would like to add some additional functionality to the standard inline Question used in many Examples of your Docs.

Is it possible to have additional Controls shown up in this Dialog?

My Use-Case is following: On a Row I press the delete button (WasteBasket on the Row) and the Inline Question pops up. As the Delete operations can be targeted in a later point in time (eg user is active for the next two months and should be deleted later on) I would like to have an additional BForms Control shown up in the inline action, which can set the the DateTime (BsDateTime Picker)

[BsControl(BsControlType.DateTimePicker)]
public BsDateTime ExecutionDate { get; set; }

By clicking Ok, the selected DateTime is sent also to the Backend...

I saw, that in the Options theres also a property called "content" and that it's possible to set templates, but i couldnt figure out on how to put the DatePicker in it so that it is properly initialised and send the Date to the backend too..

bsInlineQuestion.prototype.options = {
        template: '<p>{{question}}</p>' +
                    '<hr />' +
                    '{{#buttons}}' +
                        '<button type="button" class="btn bs-popoverBtn {{cssClass}}"> {{text}} </button> ' +
                    '{{/buttons}}',
        contentTemplate: '{{{content}}}' +
                          '<hr />' +
                         '{{#buttons}}' +
                             '<button type="button" class="btn bs-popoverBtn {{cssClass}}"> {{text}} </button> ' +
                         '{{/buttons}}',
        jqueryContentTemplate: '<div>' +
                                '<span class="js-replaceme"></span>' +
                                  '<hr />' +
                                 '{{#buttons}}' +
                                     '<button type="button" class="btn bs-popoverBtn {{cssClass}}"> {{text}} </button> ' +
                                 '{{/buttons}}' +
                             '</div>',
        placement: 'left',
        placementArray: 'left,right,bottom,top',
        content: undefined,
        stretch: false,
        closeOnOuterClick: true
    };

Thanks in advance for your Answers

Regards Dumitru