Exemplo n.º 1
0
        private static string RenderCeldaDelTd(CeldaDelGrid <TElemento> celda)
        {
            var    idDelInput  = $"{celda.idHtml}";
            string pulsarCheck = RenderEventoPuslsa(celda, idDelInput);

            var tipoHtml = celda.Tipo == typeof(bool) ? "type =¨checkbox¨" : "type =¨text¨";
            var onclick  = celda.Tipo == typeof(bool)
                  ? $"onclick=¨{pulsarCheck}¨"
                  : "";


            var editable = !celda.Editable ? "readonly" : "";

            var nombreInput = $"{celda.Propiedad}.{celda.Fila.Datos.IdHtml}".ToLower();

            var input = $" <input {tipoHtml} id=¨{idDelInput}¨ " +
                        $"        name=¨{nombreInput}¨ " +
                        $"        style=¨width:100%; border:0; text-align: {celda.AlineacionCss()};¨ " +
                        $"        propiedad=¨{celda.Propiedad}¨ " +
                        $"        style=¨width:100%; border:0¨ " +
                        $"        {editable} " +
                        $"        {onclick} " +
                        $"        value=¨{celda.Valor}¨ />";

            return(input);
        }
Exemplo n.º 2
0
        public void AnadirCelda(CeldaDelGrid <TElemento> celda)
        {
            foreach (var c in Celdas)
            {
                if (c.Propiedad == celda.Propiedad)
                {
                    return;
                }
            }

            celda.Fila        = this;
            celda.NumeroCelda = Celdas.Count;
            Celdas.Add(celda);
        }
Exemplo n.º 3
0
        private static string RenderEventoPuslsa(CeldaDelGrid <TElemento> celda, string idControlHtml)
        {
            var getorDeEventos = RenderGestorDeEventos(celda.Fila.Datos.Mnt.Crud.Modo);

            var parametros = $"{celda.Fila.idHtmlCheckDeSeleccion}#{idControlHtml}";

            if (celda.Fila.Datos.Mnt.Crud.Modo == ModoDescriptor.SeleccionarParaFiltrar ||
                celda.Fila.Datos.Mnt.Crud.Modo == ModoDescriptor.Relacion ||
                celda.Fila.Datos.Mnt.Crud.Modo == ModoDescriptor.Consulta)
            {
                parametros = $"{celda.Fila.Datos.IdHtmlModal}#{parametros}";
            }

            return($"Crud.{getorDeEventos}('{TipoDeAccionDeMnt.FilaPulsada}', '{parametros}');");
        }
Exemplo n.º 4
0
        private static string RenderTd(CeldaDelGrid <TElemento> celda)
        {
            var    nombreTd    = $"td.{celda.Propiedad}.{celda.Fila.Datos.IdHtml}".ToLower();
            string pulsarCheck = RenderEventoPuslsa(celda, celda.idHtmlTd);

            var onclickTd = $"onclick=¨{pulsarCheck}¨";
            var ocultar   = celda.Visible ? "" : "hidden";

            var tdHtml = $@"<td id=¨{celda.idHtmlTd}¨ 
                                name=¨{nombreTd}¨ 
                                style=¨text-align: {celda.AlineacionCss()};¨ 
                                propiedad=¨{celda.Propiedad}¨ 
                                {onclickTd} 
                                {ocultar} >
                                {RenderCeldaDelTd(celda)}
                           </td>";

            return(tdHtml);
        }