I can't find anywhere a simple multi-select using css, this is how select looks when attr multiple added
I need to build on top of it more functionality and use it as an angular component, I'm building an angular library and I don't want it to depend on any other plugin
why you don't want to use any plugins! it simplifies the issue instead of writing too many lines,
I advise to use (chosen plugin) and here is an example of it
chosen plugin (multiple select)
Related
I need to create split div functionality in reactjs. As shown in this fiddle. this one is implemented in extjs. I want similar implementation is reactjs. We need to add grids on either side of split panel. I am short of ideas on how to implement it. Not looking for code, but need ideas.
Hi you can check this package called react-split-pane. Also there you can find example for you case. Also there others examples.
I am looking for something p-autocomplete with result having checkboxes for every row and can allow multiple rows from the result.
Please guide me with the best possible solution or an idea with I can proceed.
Cheers!!
I would recommend using multiselect that have all the feature that you want to implement in auto-complete with a checkbox.
Writing custom functionality in a component that would be riskier than using that already built-in component that has these functionalities. This will help get less error-prone components. Writing custom checkboxes in autocomplete need lots of implementation apart from functional like accessibility, arrow keys actions, etc. So go with multi-select.
So for auto-complete in multi-select component use can use the filter property.
multiselect
I am creating front end of Dashboard App using WebStorm IDE and React framework.
As I already created UI design, I want to continue with creating of layout. I want firstly create empty rectangles and then insert functions in them (not sure if it is the best workflow)
But there is a problem, that layout is a bit complicated, see picture:
How should I proceed?
Should I use nested div tags and insert them into render function? Or there is other solution?
Should I use nested div tags and insert them into render function?
Yes, that's exactly how you should proceed.
Use css to display them like you want. You can use front-end libraries to help you, like:
Material UI
React Bootstrap
If you want to use bootstrap, you can have a look at how to display the grid system.
You can also follow this tutorial from w3schools to learn more about flexbox and how it works only with css (without material or bootstrap)
I am creating a greenfield application in Angular.
I was wondering what to do with the userinput.
I will create 10+ date inputs, 20 text inputs, 8 dropdowns, 30 buttons, 10+ currency input etc., all with validation.
With my background as a .NET developer I am used to have a lot of html for each control (html control, lots of bootstrap, validation line), duplicated throughout all the html.
Now in Angular there are directives.
Should I create a directive for each type of user input?
And with 'should I' I mean in a pragmatic way (because it's very handy) and/or a architectual way (because it is better architectual).
The second reason I ask is because I find the directives syntax one of the more difficult parts to learn.
In my opinion you should not create any directive for inputs / selects.
Html code for inputs and selects is to short and easy, so directive will not help you at all. Instead of use on inputs build in angular directives Lets look:
<input ng-model=""
ng-disable=""
ng-pattern="for email format"
for select you can use also ng-options
for validation purpose you ca use something like that:
ng-class="{'has-error': !joinForm.password.$valid && !joinForm.password.$pristine }"
So I think custom directives will only complicate your work
There are a lot of things in angular for inputs and so on.
You may have to add directives for custom validation, you can find sample on the net.
Check this sample http://weblogs.asp.net/dwahlin/building-a-custom-angularjs-unique-value-directive
Note that this sample is not the cleanest one.
This one is better : http://www.codelord.net/2014/11/02/angularjs-1-dot-3-taste-async-validators/
However i think you should start with implementing the 1st one before going for the 2nd if you want, to do it in a step by step way. And yes directives syntax and usage of ngModelController are not so easy.
Other sample : in order to reduce the html to type and ensure that i have all my fields with the same presentation (label on the left, error messages, info tooltip on the right,...). I create a directive for this. It's a matter of how far do you want to go, and how long do you have, to do this.
Most of all : before reinventing the wheel, check on the net, if it isn't supported natively by angular, there is a tons of things already done and shared online.
I would tend to agree with Przemek that in general it would over complicate things. With the exception that you might build a re-useable form that you want to pre-build for use in multiple places. I have worked on an Angular app recently which had multiple edit panels and we essentially built custom directives for common components that were then put together to make individual forms/edit panels. But not single elements.
I'm writing a single page web application using AngularJS framework with angular-ui extension.
I want to create my own look and feel for all kind of GUI components like DropdownList, DatePicker and other custom components.
When should I write custom directives and when should I use HTML tags like div, and span whith css classes (borders, background, additional buttons when hovering and more) in order to accomplish that?
Is it better or worse to create custom directives or html tags with classes?
What do you think?
Thanks
Directives are used for DOM manipulation - if you can achieve what you want with only a class, then do it. If you need to use different HTML elements / alter the functionality of the elements, apply a directive.