Tabbed Form in Ant Design Not Possible - antd

Tabbed Form doesn't seem possible in AntDesign v4
Blockers
On Submit only current active tab form values comes
If i have to generate tabs dynamically like English, French, Italian, i cannot initialize Form as tab loop will come inside of component

You can use the forceRender props on <TabPane> :
<TabPane tab="Tab1" key="1" forceRender>
<TabPane> component API on Ant Design doc :
forceRender : Forced render of content in tabs, not lazy render after clicking on tabs.
Boolean | Default false

Related

jQuery UI 1.12 – Activating a tab via link or URL

How can I activate a tab based on a hash tag (element ID) in the URL?
I know this question has been asked several times over the years, but the answers are no longer relevant for jQuery 1.10+.
Thanks.
There's two steps to accomplishing this - first, match up the hash tag (e.g. #SomeValue) to the element ID of the Tab you want active; then second, set said Tab as active.
var matchedTab = $('a[href="' + window.location.hash + '"]');
$('#tabs').tabs({active:$('#tabs a').index(matchedTab)});
The first line is creating a jQ object from the tab element whose href attributes matches the hash in the URL. Since the markup of the Tabs plug-in requires (documentation) you have an anchor <a> element with an href attribute, this will find the correct tab (assuming you have one that corresponds to the hash in the URL).
The second line then uses the active initialization option to set the desired active tab when initializing the Tabs. The active option though requires the zero-based index of that tab within the Tabs collection, so we use the .index() jQuery function to get that index & pass it to the active option.
Since the sandbox sites all use secured frames, I had to use a dropdown with dummy URLs to "simulate" different how different hash tags work, but it will function just the same using the code above.
CodePen here: https://codepen.io/anon/pen/YvyxvL
You can use the dropdown on that page to simulate the behavior of URLs with different hash tags setting different tabs to active.

How can I remove the "Links" tab in the TFS 2018 work item forms?

On the MS website there is an instruction how to customize the form data of the "Details" tab:
But how to customize (and remove) the tab itself?
No, we cannot remove the build-in tabs.
Generally, we just need to remove the control element in Layout, then the filed will be disappeared in the work item form.
But based on my test, we cannot remove the Tab control for the specific WIT definition file (xml), it will automatically add the control element during the importing action eventhough you removed it before. (Import, export, and manage work item types)
We can only custome the extension to show or hide the tab there. See Add extensions in work item form via work item type definition xml for details.
For example:
To show a tab in work item form, just add an extension tag below the "Work Item Extensions" section
<Extensions>
<Extension Id="example.color-control-dev" />
</Extensions>
Remove the extension tag to hide the tab.
Similar thread for your reference : TFS Work Item Tab Visiblity

How to create a Editor editable sidebar in Umbraco?

How can I create a sidebar in Umbraco that is common to all pages that uses a specific template, but is still editable for a editor?
If I simply create the sidebar in the template I would have to edit it myself every time they want something changes.
On the other hand if I create a sidebar field in the document type and map it to the sidebar in the template the editors have to recreate the same sidebar content for every page.
It's possible to use the recursive property on your template.
Basically what you do is on your homepage, or which ever root node for the section you want to use, you create the property which will contain your sidebar text. I would suggest the homepage.
Then you add a page field on the template with the attribute recursive=true
You can add the page field by adding the property a follows
This would result in a field that looks something like the following
<umbraco:Item field="category" recursive="true" runat="server" />
In my example, the property on the homepage which is being used is category.
Then any page which exists below the homepage, if it doesn't have a property with the same alias, then the value from the homepage will be taken.
A very useful feature :)

Change CSS style using drop down menu in MVC

I'm trying to make a drop down menu that has a bunch of items (Amelia, Cerulean, Cosmo, Cyborg, Flatly, Journal). Each of these items represent a css file.
When one of them is selected I want my website to take this selected css file and apply it to the website.
I would like the drop down menu to interact with jquery, meaning when a item is selected jquery takes over and makes a asyn/ajax call to some mvc actionresult.
By the way I'm using MVC 5.
I hope someone can help me sketch the initial groundwork.
I've implemented this in my application.
I'm not sure what to tell you though. It's easier when we have an attempted solution to fix.
Here's an overview of how mine works:
I have created a controller called SharedController. The purpose of it is to contain various actions that render common actions. All of the actions are considered ChildActionOnly.
My _Layout uses RenderAction to render the action NavbarPartial which is in my SharedController.
More importantly the Navbar partial then uses RenderAction to render the action ThemeListPartial. This action is responsible for getting a list of available themes. The list of available themes is determined at applications startup. I've created a ThemeFinder class and ThemeRepository class that are responsible for finding and storing themes. The ThemeFinder finds themes by expressions that you give it. In a new class called App_Start/ThemeConfig I've given it only one expression - "~/Content/themes/{name}.bootstrap.css". This will find all themes with that naming convention in that location.
My razor code will take the ViewModel and display a dropdown menu in the navbar.
To get the themes to change my dropdown menu contains an AJAX link to an action called SaveTheme in ThemeController. This action takes a theme name as a string and tries to save it in a cookie for the user.
If the theme is found and saved successfully, the action responds with a success message.
jQuery then changes the theme by finding the associated link attribute and changing the HREF contents to the new theme. It knows the new theme relative URL because I have it stored in data attributes.
I completed this before I made the switch to AngularJs. The one thing I plan to go back and change is to cut out as much (maybe all) jQuery as possible and replace it with better code.

Creating ajax-enabled subform with "Edit" button

I am looking for the best way to create ajax enabled subforms from items in a list with MVC 3. A static list of values should be generated, but with an "edit" link/button next to every item, to toggle inline edits.
I did follow the tutorial at this link
http://blog.janjonas.net/2011-07-24/asp_net-mvc_3-ajax-form-jquery-validate-supporting-unobtrusive-client-side-validation-and-server-side-validation [1]
However it is based on the form edit fields always being visible
I'd like to show a static list with field values, but let the user activate an edit field by clicking "edit" (e.g. button)
I did modify the example at [1] by creating a default partial view with a form with submit button only. When posting the data by ajax the edit form will show. It looks like it is working, (I only need to hide validation errors on the first POST - which does not send real data).
Update:
An even better solution would probably be to leave out all forms in the static view, just have a single css class button/link next to each item, and let jquery fetch the relevant view for the clicked item. I am not sure how to do that with MVC 3+jQuery though.
Another update:
I discovered Ajax.Actionlink, which did exactly what I wanted!
I found out how to do it, and it turned out to be real simple!
I created two partial views.
One for rendering each static item. I used used Ajax.ActionLink with InsertionMode "replace", and set the parent of the item as the target
The second for rendering the form. Here I used Ajax.Beginform with similar options.
On successfully saved data, I returned the static view, on failure, I returned the partial view with the ajax form again.
I'm happy I found a MVC-centric way to do it (although it is fun creating custom stuff with jQuery)
It sounds like you need an inline editing plugin for jQuery. I would try jEditable. I have not used it myself but appears to have extensive docs.
this entry might help: code + video + explanation ;)
http://ricardocovo.wordpress.com/2011/04/03/asp-mvc3-editing-records-with-jqueryui-dialogs-and-ajaxforms/
-covo

Resources