FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour Ejemplos del foro enfocados a la web. Json -> Browse
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Ejemplos del foro enfocados a la web. Json -> Browse
Posted: Thu Jan 21, 2021 10:41 AM
Hola,

Al hilo de viewtopic.php?f=3&t=32519#p191083 , aqui podeis ver el código que ya realizamos con mod Harbour en la web

Code (php): Select all Collapse
<div class="php" id="{CB}" style="font-family: monospace;">//  {% LoadHrb( 'lib/tweb/tweb.hrb' ) %}

#include {% TWebInclude() %}

function main()

    LOCAL o, oWeb, oCol, oBrw
    LOCAL cHtml := ''
    
    <a href="http://www.php.net/define">DEFINE</a> WEB oWeb TITLE 'Browse Ajax' TABLES INIT
    
    <a href="http://www.php.net/define">DEFINE</a> FORM o ID 'demo'

    HTML o INLINE '<h3>Test Browse Ajax II</h3><hr>'
        
    INIT FORM o             
        
        ROWGROUP o
            BUTTON LABEL 'Url ENDPOINT: <!-- m --><a class="postlink" href="https://www.w3schools.com/angular/customers.php'">https://www.w3schools.com/angular/customers.php'</a><!-- m --> GRID 6 ACTION 'LoadCustomers()' OF o  
        ENDROW o
        
        ROWGROUP o                  
            
            <a href="http://www.php.net/define">DEFINE</a> BROWSE oBrw ID 'ringo' HEIGHT 400 TOOLS <a href="http://www.php.net/print">PRINT</a> EXPORT SEARCH OF o
            
                    ADD oCol TO oBrw ID 'Name'      <a href="http://www.php.net/header">HEADER</a> 'Name  '  ALIGN 'right'
                    ADD oCol TO oBrw ID 'City'      <a href="http://www.php.net/header">HEADER</a> 'City'    <a href="http://www.php.net/sort">SORT</a>
                    ADD oCol TO oBrw ID 'Country'   <a href="http://www.php.net/header">HEADER</a> 'Country' <a href="http://www.php.net/sort">SORT</a>                   
        ENDROW o
        
        HTML o
            <script>

                var oBrw = new TWebBrowse( 'ringo' )

                function LoadCustomers() {
                     
                    oBrw.Loading()
                    
                    MsgServer( 'https://www.w3schools.com/angular/customers.php', null, Post_LoadCustomer )
                }
                
                function Post_LoadCustomer( dat ){

                    oBrw.Loading(false)                 
                    
                    oBrw.SetData( dat.records ) 
                }                           
                
            </script>       
        ENDTEXT
    
    <a href="http://www.php.net/end">END</a> FORM o
    
retu nil
 </div>


Aqui podeis verlo en acción :-) -> https://modharbour.app/tweb/browse-ajax2
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix

Continue the discussion