vtfuture / bforms Goto Github PK
View Code? Open in Web Editor NEWBootstrap Forms for ASP.NET MVC
License: MIT License
Bootstrap Forms for ASP.NET MVC
License: MIT License
PagerSettings(new BsPagerSettings { DefaultPageSize = 10 })
get overwritten by hard-coded default value 5.
Hello. I tried to add a DatePicker - control, but it's not appear (have only textbox and when click on it - no datepicker shows).
My code is:
View:
</div>
Model:
[Required]
[Display(Name = "Date", Prompt = "Enter Date")]
[BsControl(BsControlType.DatePicker)]
public BsDateTime Date { get; set; }
I'm not sure, but when I load the page, I saw 3 errors in firebug:
ReferenceError: define is not defined
....grabTemplates()})}}}})();return ich}));define("singleton-ich",["icanhaz"],funct...
(in components.js (row 339, line 1363));
ReferenceError: moment is not defined
...pl","moment","moment-calendar"],a)}else{a(window.jQuery,window.bsDatepickerRende...
(in plugins.js (row 15, line 5230));
TypeError: a is undefined
...rtable(true)}}return this.options.tags};a.widget("bforms.bsTaglist",c.prototype)...
(in widgets.js (row 1, line 73173))
My loaded JavaScript files are:
jQuery-1.10.2.js
components.js
iefix.js
plugins.js
widgets.js
Thanks!
An overload that receives a Func<TRow, MvcHtmlString> should be added to the DetailsTemplate method to get rid of redundant ToString calls.
BsFormFor should encapsulate fields and actions.
INITIAL CONDITIONS
We have a model which contains a list of other model type ( as a property )
eg : public List< OtherModel > MyProperty{ get; set; }
and OtherModel contains ( for example ) a property of type radio button list
[BsControl(BsControlType.RadioButtonList)]
public BsSelectList<something?> OtherModelProperty{ get; set; }
PROBLEM
When we try to render MyProperty in our view, in a for statement, bs helpers doesn't work ( it throws null error - object reference not set to an instance ..., even if our list is binded to some data)
eg:
for (var i = 0; i < Model.MyProperty.Count(); i++)
{
@Html.BsLabelFor(m => Model.MyProperty[i].OtherModelProperty
}
For the moment, the only solution is to render OtherModelProperty in a prefixed partial view.
When you press enter on the grid's quick seach text input, the page refreshes.
When saving a web-part in grid details, the updateRow() function should check if there are any web-parts in edit mode, if there are any, updateRow() should refresh only the read-only ones and leave the editable parts untouched.
Add option to trigger Collapse/Expand on row click, if cell text is selected then inhibit the toggle.
To reproduce:
var validated = $("form").validate();
validated.showErrors({"BsFormError": "test"}, true);
No summary will be shown.
Seems to be introduced in 772a42e.
The summary is shown at line 434, but it is removed at line 453 since there's no element to be referenced to it and it isn't added in the errorList array.
Replace rec/page native drop-down with bootstrap navbar dropdown-menu. Add "go top" icon, that will trigger scrolling at toolbar, if there is no toolbar then scroll to grid h2.
action that moves all visible search results to connectable groups
Hello!
It would be nice if rowActions parameter of the grid widget will work even details being disabled
For example, I want to add a custom column with delete button, setup handler via rowActions parameter.
Similar to toolbar component the bulk actions bar should support default and custom actions.
By default, if a bulk action bar is attached to a grid, then the last column should be of type checkbox.
Default actions:
Extend the BsToolbarFor helper to support a QuickSearch textbox component.
The QuickSearch component should trigger a server-side search query that contains all advanced search fields with OR condition.
Localizations for grid pager stored in BF_XXX keys inside resx-file.
But the title for "Go top" button stored as Grid.prototype property pagerGoTopTitle.
Yes, I can write my localized value like:
// init grid
this.$grid.bsGrid({
pagerGoTopTitle: 'localized go top'
// another grid options
});
I think, will be better to localize the title with resx-file like other pager strings.
PS:
But best approach I think - is using localizations via javascript (select2.js for example). We can easy transform our localization string depend from parameters, like:
4 datepickers give you a 2-3 second page block
Page loading is also severely affected by this issue
Colors to be added as class names:
blue, green, orange, purple, black
Where they need to be added:
The change colors widget (fixed boxed on the right) will be collapsed by adding the "collapsed" class to .select_theme
Implement edit-in-place option for fields displayed in grid row.
grids_header_submit - grid_toolbar_submit
grids_container - grid_container
grids_header_bar - grid_toolbar
grids_controls - grid_toolbar_controls
grids_header_expand - grid_toolbar_form
action_buttons - grid_bulk_controls
grid_wrapper - grid_rows
row_wrapper - grid_rows_wrapper
row_color - grid_row_color
row_more - grid_row_details
js-item - bs-item
js-details - bs-details
js-rowDetails - bs-rowDetails
js-filter - bs-filter
js-add - bs-add
js-row_check - bs-row_check
js-group_actions - bs-group_actions
js-confirm - bs-confirm
js-cancel - bs-cancel
js-pages - bs-pages
js-selector - bs-selector
js-readonly - bs-readonly
js-edit_mode - bs-edit_mode
bs-validationSummaryContainer - bs-validation_summary
bs-validationRowActionsContainer - bs-validation_row_action
bs-errorRowContainer - bs-validation_row
form-container - form_container
bforms-radioButtonsList - bforms-radiolist
bforms-checkBoxList - bforms-checklist
The filter icon should be clickable, when clicked will remove all filters and clear the QuickSearch textbox and advanced search fields. @oanamangiurea create an icon that will suggest the reset function.
I made check references for IsEditable property of BsGridColumnAttribute and found that it is just stub and doesn't work with helpers anywhere.
Also I found InlineEditable() method which as described enables editing of the cell. But I can't toggle it to the editable state, because domNode with toggle_edit class still unvisible with display:none style and again there are no program logic in the project which take account for this.
Is there some way to make rows being inline editable without detail template?
Implement a bulk action button that will export to excel the selected rows in a grid. The resulting excel should contain all visible grid columns, and optionally all columns visible in grid row details panel.
I have a BsGrid(...) with sortable columns.
When I click the title to reorder, its make Ajax request, I processed the data in Controller and return the correct ordered data. But grid wasn't "refreshed" with ordered data.
My code is:
public ActionResult List(BsGridBaseRepositorySettings settings)
{
var all = this._service.GetAll();
var gridItems = AutoMapper.Mapper.Map<List>(all);
if (settings.OrderableColumns[0].Type == BsOrderType.Descending)
{
gridItems = gridItems.OrderByDescending(x => settings.OrderableColumns[0].Name == "Name" ? x.Name : x.Type).ToList();
}
else
{
gridItems = gridItems.OrderBy(x => settings.OrderableColumns[0].Name == "Name" ? x.Name : x.Type).ToList();
}
return Json(new { result = gridItems });
}
Grid's code in View is:
@using (Html.BsGridWrapper())
{
@(
Html.BsGridFor(m => m.Grid)
.ConfigureColumns(cols =>
{
cols.For(x => x.Name).Name("Name");
cols.For(x => x.Date).Name("Date")
.Text(i => i.Date.DateValue.GetValueOrDefault().ToString(E_Voting.Core.Common.Formating.DateFormat));
cols.For(x => x.Type).Name("Type");
})
.PagerSettings(new BsPagerSettings
{
Size = 5,
ShowFirstLastButtons = true,
ShowPrevNextButtons = true,
HasPagesText = true,
HasPageSizeSelector = true
})
.IgnoreAjaxRequest(true)
)
}
the returned data is (when order type is ASC):
{"result":[{"ID":1,"Name":"N1 2014","Date":{"TextValue":"13.11.2014 г. 0:00:00","DateValue":"/Date(1415829600000)/"},"Type":"E Type"},{"ID":2,"Name":"N2 2014","Date":{"TextValue":"3.12.2014 г. 0:00:00","DateValue":"/Date(1417557600000)/"},"Type":"P Type"},{"ID":3,"Name":"N3 2014","Date":{"TextValue":"3.12.2014 г. 0:00:00","DateValue":"/Date(1417557600000)/"},"Type":"P Type"}]}
when order is DESC:
{"result":[{"ID":2,"Name":"N2 2014","Date":{"TextValue":"3.12.2014 г. 0:00:00","DateValue":"/Date(1417557600000)/"},"Type":"P Type"},{"ID":3,"Name":"N3 2014","Date":{"TextValue":"3.12.2014 г. 0:00:00","DateValue":"/Date(1417557600000)/"},"Type":"P Type"},{"ID":1,"Name":"N1 2014","Date":{"TextValue":"13.11.2014 г. 0:00:00","DateValue":"/Date(1415829600000)/"},"Type":"E Type"}]}
The possibility to group grid rows by some selected columns.
Another project which implements this feature is here http://demo.aspnetawesome.com/GridDemo
Drag-and-Drop to reorder columns, on drag the grid rows should be in blocking state, on drop, send the columns new order to server and refresh the current page.
You want a toolbar for links and dropdowns.
One way to implement this toolbar is to have a BsToolbarModel < EmptyModel > .
Get rid of this workaround .
Hello,
I have a BsControlType.Upload property in my model:
[Display(Name = "Check List", Prompt = "Suba la foto del check list")]
[BsControl(BsControlType.Upload)]
[Required]
public string CheckList { get; set; }
And in my view, I have,
@Html.BsTextBoxFor(s => s.CheckList, new { type= "file", @class= "bs-file" })
My attributes definition works, but adding the attributes, not replacing them, causing finally the control to be rendered as:
<input type="file text" value="" placeholder="Suba la foto del check list" name="CheckList" id="CheckList" data-val-required="El campo Check List es obligatorio." data-val="true" class="bs-file form-control bs-text input-validation-error">
I have seen the source code and I think the problem is in the ApplyTextBoxAttributes method in TextBoxExtensions file.
I tried to recompile the solution, but it was not possible, so that i could not modify that code fragment.
Regards,
Jaime
Example UserProfile does not show how to achieve that layout. I need to get something similar, so it will be good if the example shows how to configure the model, the view and the controllers-
Maximum width of columns in the grid limited by 12 (bootstrap layout).
This is huge limitation! Domain model affected by css framework!
BForms grid helpers should use table tag
Column width units should support pixels or percents
Look at GridMVC for example.
Hello,
I have a form that contains a field called "code". I need to validate if that code already exists in database, so that I need to use remote valitation.
I saw bforms.validate.unobtrusive.js file and it shows a remote validation, so I know it is possible, but, how to use it?
Thanks
Best regards
Jaime
Since others are expected to include these keys into their resource files, the keys should be prefixed so that they don't clash with existing keys (BF_Of instead of Of, for example)
If you set the grid without a title header, then records ordering is not working.
@(Html.BsGridFor(x => x.Grid).ConfigureColumns(col =>
{
// some configuration code
}).PagerSettings(new BsPagerSettings
{
// some pager settings
}).NoTitle()
)
It's only possible to focus the input by clicking the label (you should be able to focus the input directly).
After you drag a group row, on drop the form resets.
When you insert a new item via toolbar add, the grid current page items count is broken (problem with selectors)
Hello,
I tried your tutorials ( http://bforms.veritech.io/Start/Grid#views ) and examples ( http://bforms.veritech.io/Demo/Contributors/?stateId=3 ), but they not work. I received errors
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0311: The type 'EM.Models.MoviesRowModel' cannot be used as type parameter 'TRow' in the generic type or method 'BForms.Html.GridExtensions.BsGridFor<TModel,TRow>(System.Web.Mvc.HtmlHelper, System.Linq.Expressions.Expression<System.Func<TModel,BForms.Models.BsGridModel>>)'. There is no implicit reference conversion from 'EM.Models.MoviesRowModel' to 'BForms.Models.BsItemModel'.
The code, which I type can be found in next link: https://dotnetfiddle.net/pJAmwG
Can you explain me where's the problem or send me working example?
Thank you!
On mobile, the date picker should be rendered inside a full screen popup. If the picker is attached to an input of type text, the filed must be disabled.
Transform the namespace, assembly name and project folder with Reshaper from BootstrapForms into BForms.
I have this Panel model:
public class PanelAsignacionIncidenciaModel
{
public enum PanelComponentsEnum
{
Informacion = 1,
Asignacion = 2
}
[BsPanel(Id = PanelComponentsEnum.Informacion, Expandable = true, Editable = false)]
[Display(Name = "Información")]
public InformacionIncidenciaModel Informacion { get; set; }
[BsPanel(Id = PanelComponentsEnum.Asignacion)]
[Display(Name = "Asignación")]
public AsignacionIncidenciaModel Asignacion { get; set; }
}
When the panels are rendered in view, and I try to expand or collapse them, the URL in the browser adds "#" to the end, but the panels are not actually expanded nor collapsed.
Add toggle button on header row, if some rows are expanded, then Expand all is on, if all are expanded then Collapse all is on. Sends an array of row ids to server and receives a list of grid row details.
Hello,
I have upagraded ia NuGet RequireJS. After that, I had to make a lot of changed, after finally I could get it work, however, I have problems with internationalization.
These erors appears in browser:
"NetworkError: 404 Not Found - http://localhost:16166/Scripts/validate-es.js"
validate-es.js
"NetworkError: 404 Not Found - http://localhost:16166/Scripts/select2-es.js"
I searched and I found this code in bforms.initUI.js 👍
if (uiLocale != 'en' && typeof uiLocale !== "undefined") {
//load external i18n files
var localeDeferred = $.Deferred();
this.deferredList.push(localeDeferred);
require([
'validate-' + uiLocale,
'select2-' + uiLocale
], function () {
localeDeferred.resolve();
});
}
Maybe bforms.initUI.js is not prepared for RequireJS.net v2? How to fix either bforms.initUI.js or configuration files to allow bforms internationalization?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.