I used in MDL in a JS project recently, and I found that if I created MDL
components after the initial page load, I needed to run the following code
once they were added to the DOM:

if("componentHandler" in window)
{
    window["componentHandler"].upgradeAllRegistered();
}

My app was divided into several screens, so I simply called that whenever I
created a new screen, and all MDL components would be upgraded.

However, I don't think this exact function is the best choice for FlexJS
MDL components. I see that there's also an upgradeElement() method, and I
think that's probably what you want to use. A component can upgrade its own
DOM and it won't affect anything else.

https://github.com/google/material-design-lite/blob/mdl-1.x/src/mdlComponentHandler.js#L47

- Josh

On Fri, Feb 17, 2017 at 5:50 AM, Carlos Rovira <
carlos.rov...@codeoscopic.com> wrote:

> Hi Sankar,
>
> when using MDL standard (non flexjs version) how things are done to
> dinamicaly create some component?
> Since FlexJS MDL is a "wrap" over MDL js/css libraries, what we should
> envision is the way to "flex"-ify the things
> coming from MDL world. So I propose that investigate the problem and see
> how it's done in JS to provide some clues
> for a solution.
>
>
> 2017-02-17 12:56 GMT+01:00 sankar <santanu4...@gmail.com>:
>
> > Hi,
> >
> > There's a critical and major problem exists with dynamic child creation
> in
> > MDL structure.
> >
> > I've reported this to JIRA at:
> > https://issues.apache.org/jira/browse/FLEX-35269.
> >
> > Request to look into this once.
> >
> > Thanks!
> >
> >
> >
> > --
> > View this message in context: http://apache-flex-
> > development.2333347.n4.nabble.com/FlexJS-MDL-Dynamic-Child-
> > Problem-tp59595.html
> > Sent from the Apache Flex Development mailing list archive at Nabble.com.
> >
>
>
>
> --
>
> Carlos Rovira
> Director General
> M: +34 607 22 60 05
> http://www.codeoscopic.com
> http://www.avant2.es
>
> Este mensaje se dirige exclusivamente a su destinatario y puede contener
> información privilegiada o confidencial. Si ha recibido este mensaje por
> error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
> proceda a su destrucción.
>
> De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
> que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
> S.A. La finalidad de dicho tratamiento es facilitar la prestación del
> servicio o información solicitados, teniendo usted derecho de acceso,
> rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
> oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
> necesaria.
>

Reply via email to