Giter VIP home page Giter VIP logo

bforms's Introduction

Logo

Bootstrap enabled ASP.NET MVC Controls

The BForms open source framework consists of a collection of ASP.NET MVC HTML Helpers, Javascript AMD modules, custom CSS made with SASS that extends Twitter Bootstrap v3 and makes development of rich user interfaces easy.

Documentation and examples website http://bforms.veritech.io/

bforms's People

Contributors

alessandromuresan avatar andreiyfrag avatar cezarcretu avatar ciprianporumbescu avatar cristipufu avatar cryptotechmaker avatar lvv83 avatar marinacaval avatar mariuscosareanu avatar mihaipanait avatar oanamangiurea avatar razvalex avatar stefanprodan 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

Watchers

 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

bforms's Issues

Request for example on using remote validation

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

DatePicker not shows

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:

@Html.LabelFor(m => m.Editor.Date)
@Html.BsGlyphiconAddon(BForms.Models.Glyphicon.Calendar) @Html.BsInputFor(m => m.Editor.Date, new { @Class = "test" }) @Html.BsValidationFor(m => m.Editor.Date)
</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!

Problem with BsControlType.Upload

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

Bs html helpers render problem

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.

Update Doc for UserProfile

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-

Prefix required resource keys

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)

BsGridColumnAttribute.IsEditable and InlineEditing

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?

Grid row details multi-edit

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.

Vars renaming

CSS

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

JS

bforms-radioButtonsList - bforms-radiolist

bforms-checkBoxList - bforms-checklist

Can't reorder grid.

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"}]}

BsToolbar without model

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 .

i18n does not work after upgrading RequireJS to v2

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?

Rewrite grid helpers to support more than 12 columns

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.

Grid bulk actions component

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:

  • Select All/None in check dropdown
  • Delete selected button
  • Export selected to excel

Reorder Grid columns

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.

Change color scheme

Colors to be added as class names:

blue, green, orange, purple, black

Where they need to be added:

  1. body
  2. form_container
  3. grid_toolbar
  4. grid_view
  5. bs-datetime-picker
  6. bs-range-picker

The change colors widget (fixed boxed on the right) will be collapsed by adding the "collapsed" class to .select_theme

Move grid's GoTop title from javascript to resx

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:

  • no items
  • 1-1 of 1 item
  • 6-10 of 100 items

Grid Example not works

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!

Grid Collapse/Expand all rows

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.

Ordering doesn't work without grid title

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()
)

Reset filters in Grid

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.

Export to excel as Grid bulk action

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.

Panels cannot be expanded or collapse

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.

Quick search in Grid Toolbar

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.

Grid pager redo right side

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.

Grid pager update on insert

When you insert a new item via toolbar add, the grid current page items count is broken (problem with selectors)

Datetime Picker mobile view

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.

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.