JS tricks Minimal theme
Some js functions example
HIDE CODE
SHOW CODE
<button onclick="Xcrud.reload()">Reload button</button>
<button onclick="Xcrud.show_message('.xcrud-ajax','This is error!','error')">Show error</button>
<button onclick="Xcrud.show_message('.xcrud-ajax','Got it!','success')">Show success</button>
<button onclick="Xcrud.show_message('.xcrud-ajax','Mmm... Maybe you right...','note')">Show note</button>
<button onclick="Xcrud.show_message('.xcrud-ajax','Some information','info')">Show info</button>
<button onclick="Xcrud.request('.xcrud-ajax',Xcrud.list_data('.xcrud-ajax',{task:'edit',primary:128}))">Edit entry #128</button>
<button onclick="Xcrud.modal('My modal','<h1>Hello World!</h1>')">Show modal</button>
<?php
$xcrud = Xcrud::get_instance();
$xcrud->table('customers');
echo $xcrud->render();
?>
<script type="text/javascript">
jQuery(document).on("xcrudafterrequest",function(event,container){
if(Xcrud.current_task == 'save')
{
Xcrud.show_message(container,'WOW!','success');
}
});
</script>
Customers
Customers
# | Customername | Contactlastname | Contactfirstname | Phone | Addressline1 | Addressline2 | City | State | Postalcode | Country | Salesrepemployeenumber | Creditlimit | Avatar | Photo | Attach | Sex | Interests | |
1 | Blauer See Auto, Co. | Keitel | Roland | +49 69 66 90 2555 | Lyonerstr. 34 | | Frankfurt | | 60528 | Germany | 1504 | 59700 | | | | male | programming | |
2 | Mini Wheels Co. | Murphy | Julie | 6505555787 | 5557 North Pendale Street | | San Francisco | CA | 94217 | USA | 1165 | 64600 | | | | male | | |
3 | Land of Toys Inc. | Lee | Kwai | 2125557818 | 897 Long Airport Avenue | | NYC | NY | 10022 | USA | 1323 | 114900 | | | | male | | |
4 | Volvo Model Replicas, Co | Berglund | Christina | 0921-12 3555 | Berguvsvägen 8 | | Luleå | | S-958 22 | Sweden | 1504 | 53100 | | | | male | | |
5 | Danish Wholesale Imports | Petersen | Jytte | 31 12 3555 | Vinbæltet 34 | | Kobenhavn | | 1734 | Denmark | 1401 | 83400 | | | | male | | |
6 | Saveley & Henriot, Co. | Saveley | Mary | 78.32.5555 | 2, rue du Commerce | | Lyon | | 69004 | France | 1337 | 123900 | | | | male | | |
7 | Dragon Souveniers, Ltd. | Natividad | Eric | +65 221 7555 | Bronz Sok. | Bronz Apt. 3/6 Tesvikiy | Singapore | | 079903 | Singapore | 1621 | 103800 | | | | male | | |
8 | Muscle Machine Inc | Young | Jeff | 2125557413 | 4092 Furth Circle | Suite 400 | NYC | NY | 10022 | USA | 1286 | 138500 | | | | male | | |
9 | Diecast Classics Inc. | Leong | Kelvin | 2155551555 | 7586 Pompton St. | | Allentown | PA | 70267 | USA | 1216 | 100600 | | | | male | | |
10 | Technics Stores Inc. | Hashimoto | Juri | 6505556809 | 9408 Furth Circle | | Burlingame | CA | 94217 | USA | 1165 | 84600 | | | | male | | |