Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUI problems with dynamically creating controlsUI problems with dynamically creating controls
Previous
 
Next
New Post
4/26/2013 6:36 PM
 

In DNN7, I have a situation where I am dynamically creating DHTML controls on a page as a user is interacting with a module.  The problem is that DNN7 makes many changes to the standard controls (radio buttons, checkboxes, input type=file, select controls, etc.) to restyle them via JavaScript/jQuery on page load. Since my DHTML controls (input type=file in particular) are created long after the page is loaded and the standard scripts have run, my new controls don't look like the others that were there on page load.

Is there a jQuery function that I need to run on the new section (div) to adjust the new controls?  Sorry if this has already been asked but my searching didn't turn-up anything that looked like it was relevant.  Hopefully the solution is a go-forward standard that won't change with future UI changes in DNN.

 
New Post
4/27/2013 8:07 AM
 
I'm not certain about this, but I think that any JS does not do restyling. You may find that just giving your new controls the correct CSS classes will let them pick up the styliing.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
4/29/2013 4:21 AM
 
The look and feel of native controls in dnn are controlled by the contents of your sites skin.
When you are creating you dynamic elements - make sure you are assigning the correct css classes to the elements as you load them.

For example to style a button or hyperlink as the primary dnn button style - thats the button showyou would you class="dnnPrimaryAction" - or the button normally used for cancel type actions using class="dnnSecondaryAction".

Westa
 
New Post
4/30/2013 12:45 PM
 
Just a quick followup for anyone that finds this thread in the future. This turned-out to be more than just a CSS issue. There is javascript that is built-into DNN that makes major changes to the file upload control (input type=file.) This code wraps the control in a SPAN and adds various classes, etc. Because the control is created after the page has loaded (actually fetching it via AJAX) this script code is not getting run on the new control. The solution was to invoke a jQuery function on the newly-created control:

$('#MyNewControlId').dnnFileInput();
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUI problems with dynamically creating controlsUI problems with dynamically creating controls


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out