Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
funciones:nfl_updatebyid [04/09/2022 11:20] pedro |
funciones:nfl_updatebyid [14/12/2023 15:48] (actual) pedro |
||
---|---|---|---|
Línea 20: | Línea 20: | ||
===== Ejemplo de uso por AJAX ===== | ===== Ejemplo de uso por AJAX ===== | ||
- | {{url>https://samples.nefele.dev/wiki/updatebyid 100%,130px}} | + | {{url>https://samples.nefele.dev/wiki/updatebyid 100%,140px}} |
<Code:xailer linenums:1> | <Code:xailer linenums:1> | ||
PROCEDURE vUpDateById( o ) | PROCEDURE vUpDateById( o ) | ||
Línea 27: | Línea 27: | ||
:lValign := .T. | :lValign := .T. | ||
WITH OBJECT WBevel():New( :WO ) | WITH OBJECT WBevel():New( :WO ) | ||
- | :aWidth[ xc_S ] := 6 | + | :aWidth[ xc_S ] := 5 |
- | WITH OBJECT WButton():New( :WO ) | + | WITH Object WButton():New( :WO ) |
:cText := "Activar Pulse" | :cText := "Activar Pulse" | ||
:cOnClick := "UpDateById1" // Esto realmente llama a AjaxUpdateById( .T. ) | :cOnClick := "UpDateById1" // Esto realmente llama a AjaxUpdateById( .T. ) | ||
Línea 35: | Línea 35: | ||
:lLarge := .T. | :lLarge := .T. | ||
:lCenter := .T. | :lCenter := .T. | ||
- | :nFix := "75%" | + | :nFix := "90%" |
- | :Create() | + | |
- | END WITH | + | |
- | WITH OBJECT WButton():New( :WO ) | + | |
- | :cText := "Desactivar Pulse" | + | |
- | :cOnClick := "UpDateById2" // Esto realmente llama a AjaxUpdateById( .F. ) | + | |
- | :cIcon := "blur_off" | + | |
- | :cAjaxBevel := "nflcargo" | + | |
- | :lLarge := .T. | + | |
- | :lCenter := .T. | + | |
- | :nFix := "75%" | + | |
:Create() | :Create() | ||
END WITH | END WITH | ||
Línea 52: | Línea 42: | ||
WITH OBJECT WBevel():New( :WO ) | WITH OBJECT WBevel():New( :WO ) | ||
- | :aWidth[ xc_S ] := 6 | + | :aWidth[ xc_S ] := 2 |
+ | :lHcenter := .T. | ||
WITH OBJECT WIcon():New( :WO ) | WITH OBJECT WIcon():New( :WO ) | ||
:cId := "oicon" | :cId := "oicon" | ||
Línea 61: | Línea 52: | ||
:Create() | :Create() | ||
END WITH | END WITH | ||
+ | |||
+ | WITH OBJECT WBevel():New( :WO ) | ||
+ | :aWidth[ xc_S ] := 5 | ||
+ | WITH Object WButton():New( :WO ) | ||
+ | :cText := "Desactivar Pulse" | ||
+ | :cOnClick := "UpDateById2" // Esto realmente llama a AjaxUpdateById( .F. ) | ||
+ | :cIcon := "blur_off" | ||
+ | :cAjaxBevel := "nflcargo" | ||
+ | :lLarge := .T. | ||
+ | :lCenter := .T. | ||
+ | :nFix := "90%" | ||
+ | :Create() | ||
+ | END WITH | ||
+ | :Create() | ||
+ | END WITH | ||
+ | |||
:Create() | :Create() | ||
- | End With | + | END WITH |
RETURN | RETURN | ||
Línea 89: | Línea 96: | ||
===== Ejemplo de uso directamente con JS ===== | ===== Ejemplo de uso directamente con JS ===== | ||
- | {{url>https://samples.nefele.dev/wiki/updatebyid 100%,130px}} | + | {{url>https://samples.nefele.dev/wiki/updatebyid2 100%,140px}} |
<Code:xailer linenums:1> | <Code:xailer linenums:1> | ||
PROCEDURE vUpDateById2( o ) | PROCEDURE vUpDateById2( o ) | ||
Línea 96: | Línea 103: | ||
:lValign := .T. | :lValign := .T. | ||
WITH OBJECT WBevel():New( :WO ) | WITH OBJECT WBevel():New( :WO ) | ||
- | :aWidth[ xc_S ] := 6 | + | :aWidth[ xc_S ] := 5 |
- | WITH Object WButton():New( :WO ) | + | WITH OBJECT WButton():New( :WO ) |
:cText := "Activar Pulse" | :cText := "Activar Pulse" | ||
:cOnClick := "js:" + nfl_UpdateById( { { "oicon", .T., "pulse" },; | :cOnClick := "js:" + nfl_UpdateById( { { "oicon", .T., "pulse" },; | ||
Línea 104: | Línea 111: | ||
:lLarge := .T. | :lLarge := .T. | ||
:lCenter := .T. | :lCenter := .T. | ||
- | :nFix := "75%" | + | :nFix := "90%" |
- | :Create() | + | |
- | END WITH | + | |
- | WITH OBJECT WButton():New( :WO ) | + | |
- | :cText := "Desactivar Pulse" | + | |
- | :cOnClick := "js:" + nfl_UpdateById( { { "oicon", .F., "pulse" },; | + | |
- | { "oicon", "red-text", "removeclass" } } ) | + | |
- | :cIcon := "blur_off" | + | |
- | :lLarge := .T. | + | |
- | :lCenter := .T. | + | |
- | :nFix := "75%" | + | |
:Create() | :Create() | ||
END WITH | END WITH | ||
Línea 121: | Línea 118: | ||
WITH OBJECT WBevel():New( :WO ) | WITH OBJECT WBevel():New( :WO ) | ||
- | :aWidth[ xc_S ] := 6 | + | :aWidth[ xc_S ] := 2 |
+ | :lHcenter := .T. | ||
WITH OBJECT WIcon():New( :WO ) | WITH OBJECT WIcon():New( :WO ) | ||
:cId := "oicon" | :cId := "oicon" | ||
Línea 130: | Línea 128: | ||
:Create() | :Create() | ||
END WITH | END WITH | ||
+ | |||
+ | WITH OBJECT WBevel():New( :WO ) | ||
+ | :aWidth[ xc_S ] := 5 | ||
+ | WITH OBJECT WButton():New( :WO ) | ||
+ | :cText := "Desactivar Pulse" | ||
+ | :cOnClick := "js:" + nfl_UpdateById( { { "oicon", .F., "pulse" },; | ||
+ | { "oicon", "red-text", "removeclass" } } ) | ||
+ | :cIcon := "blur_off" | ||
+ | :lLarge := .T. | ||
+ | :lCenter := .T. | ||
+ | :nFix := "90%" | ||
+ | :Create() | ||
+ | END WITH | ||
+ | :Create() | ||
+ | END WITH | ||
+ | |||
:Create() | :Create() | ||
END WITH | END WITH |