Search This Blog

Showing posts with label belajar. Show all posts
Showing posts with label belajar. Show all posts

Tuesday, April 7, 2015

Sencha ExtJS 5 , using Sencha Cmd in Wamp directory

Sencha ExtJS 5 is very powerfull javascript framework , you can start to build your first application by using scafolding feature.  what you need to do is download sencha cmd 5 for windows.

In this case i am using Wamp Server , so the folder should be generated in wamp\www after i run the command

1. Download sencha extjs 5.0.1 gpl
2. Extract the zip file in any location for example i will extract it in D:\
3. Install the Sencha Cmd 5 , by default it will be installed in C:\users\administrator\bin\sencha
4. Go to start --> Cmd (to open your windows command prompt)
5. use this command bellowed


C:\Users\Administrator>sencha -sdk d:ext-5 generate app Aplikasiku d:\wamp\www\ext5-aplikasiku

aplikasiku is your scaffolding application name , ext5-applikasiku is your web application folder

the process will be looked like this ...

Sencha Cmd v5.1.2.52
[INF] Processing Build Descriptor : default
[INF] Loading app json manifest...
[INF] Appending content to d:\wamp\www\
ext5-aplikasiku/bootstrap.js
[INF] Writing content to d:\wamp\www\
ext5-aplikasiku/bootstrap.json


That's it, your startup application is ready to access by using your localhost path address
Thanks

Regards,


Hery Purnama
Freelance IT Trainer

Thursday, January 22, 2015

Jquery Ajax clear form after submit

How to clear your form after submission using Jquery

The easiest way is using

$('#formId').trigger("reset")


Example

$(document).ready(function(e) {
    $("#btntambah").click(function(){
        var nama = $("#txtnama").val(); // cara jquery mangambil value dari object html dengan id txtnamaprd
        var kota = $("#txtkota").val();
        var detail = $("#txtdetail").val();
       

    $.ajax({ // ajax jqeury untuk mengirim value dengan methode post
            type: "POST",
            url: urlService+'proses.php?mode=add', // proses.php berisi php dengan script sql insert
            data:"txtnama="+nama+'&txtkota='+kota+'&txtdetail='+detail,
            success: function(data){
                $("#result").html(data); // callback respon ajax apabila proses.php berhasil, hasil dikembalikan ke halaman html di tag dengan id #result
            }
    });
   
$('#frmnasabah').trigger("reset") // form field di reset
   


    })
});