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 | aZbyszek Zbyszek Piestrzeniewicz | Piestrzeniewicz | Zbyszek | 266427555 | ul. Filtrowa 68 | | Warszawa | Nairobi | 01-012 | Poland | | 1230 | | | | male | cars, fights, cooking | View Edit Remove |
2 | Blauer See Auto, Co. | Keitel | Roland | +49 69 66 90 2555 | Lyonerstr. 34 | | Frankfurt | | 60528 | Germany | 1504 | 59700 | | | | male | | View Edit Remove |
3 | Mini Wheels Co. | Murphy | Julie | 6505555787 | 5557 North Pendale Street | | San Francisco | CA | 94217 | USA | 1165 | 64600 | | | | male | | View Edit Remove |
4 | Land of Toys Inc. | Lee | Kwai | 2125557818 | 897 Long Airport Avenue | | NYC | NY | 10022 | USA | 1323 | 114900 | | | | male | programming, fights, cooking | View Edit Remove |
5 | Euro+ Shopping Channel | Freyre | Diego | (91) 555 94 44 | C/ Moralzarzal, 86 | | Madrid | | 28034 | Spain | 1370 | 227600 | | | | male | | View Edit Remove |
6 | Volvo Model Replicas, Co | Berglund | Christina | 0921-12 3555 | Berguvsvägen 8 | | Luleå | | S-958 22 | Sweden | 1504 | 53100 | | | | male | | View Edit Remove |
7 | Danish Wholesale Imports | Petersen | Jytte s dh | 31 12 3555 | Vinbæltet 34 | | Kobenhavn | | 1734 | Denmark | 1401 | 83400 | | | | male | | View Edit Remove |
8 | Saveley & Henriot, Co. | Saveley | Mary | 78.32.5555 | 2, rue du Commerce | | Lyon | | 69004 | France | 1337 | 123900 | | | | male | | View Edit Remove |
9 | Dragon Souveniers, Ltd. | Natividad | Eric | +65 221 7555 | Bronz Sok. | Bronz Apt. 3/6 Tesvikiye | Singapore | | 079903 | Singapore | 1621 | 103800 | | | | male | | View Edit Remove |
10 | Muscle Machine Inc | Young | Jeff | 2125557413 | 4092 Furth Circle | Suite 400 | NYC | NY | 10022 | USA | 1286 | 138500 | | | | male | | View Edit Remove |