Hola,
He integrado el modulo de sesiones en TWeb
https://m.facebook.com/story.php?story_ ... 3474978505
C.
Carles wrote:Hola,
He integrado el modulo de sesiones en TWeb
https://m.facebook.com/story.php?story_ ... 3474978505
C.
// {% LoadHrb( 'lib/tweb/tweb.hrb' ) %}
#include {% TWebInclude('lib/tweb/') %}
function Main()
local oWeb, o, oBrw
if ! Is_Session()
Redirect( "login2.prg" )
retu nil
endif
DEFINE WEB oWeb TITLE 'Listado de códigos' TABLES INIT
DEFINE FORM o ID 'demo'
INIT FORM o
HTML o INLINE '<h5>LISTADOS DE PRECIOS</h5><hr>'
ROWGROUP o
SEPARATOR o LABEL 'Listados de productos'
GET ID 'buscar' VALUE '' GRID 10 LABEL 'Buscar' PLACEHOLDER 'ingrese palabra a buscar' BUTTON ' Buscar' ACTION 'LoadState()' OF o
BUTTON ID 'btn' LABEL ' Volver' ACTION 'volver()' GRID 2 ICON '<i class="fas fa-home"></i>' CLASS 'btn-primary btnticket' OF o
END o
ROWGROUP o
DEFINE BROWSE oBrw ID 'ringo' HEIGHT 600 OF o
ADD oCol TO oBrw ID 'descr' HEADER 'Descripción'
ADD oCol TO oBrw ID 'precio' HEADER 'precio'
ADD oCol TO oBrw ID 'stock' HEADER 'Stock'
END o
HTML o
<script>
function volver() {
window.history.back();
}
var oWnd
var oBrw = new TWebBrowse( 'ringo' )
function LoadState() {
oWnd = MsgLoading("Espere....")
var cBuscar = $('#buscar').val()
console.log( cBuscar )
MsgServer( 'listaprecioserver.prg', cBuscar, Post_LoadState )
}
function Post_LoadState( dat ){
oWnd.modal('hide');
oBrw.SetData( dat.rows )
}
$(document).ready(function () {
oBrw.Init()
})
</script>
ENDTEXT
END FORM o
Users browsing this forum: No registered users and 3 guests