jquery.blade.php 2.39 KB
$(document).ready(function(){
   $('.tambah').click(function(){
		ojisatrianiLoadingFadeIn();
		$.loadmodal({
			url: "{{ url($url_admin.'/policy/create') }}",
			id: 'responsive',
			dlgClass: 'fade',
			bgClass: 'primary',
			title: 'Tambah',
			width: 'whatever',
			modal: {
				keyboard: true,
				// any other options from the regular $().modal call (see Bootstrap docs)
				},
          ajax: {
				dataType: 'html',
				method: 'GET',
				success: function(data, status, xhr){
            ojisatrianiLoadingFadeOut();
				},

			},
        });
  });

	$(document).on("click",".ubah",function() {
    ojisatrianiLoadingFadeIn();
		var id = $(this).attr('policy-id');
		$.loadmodal({
			url: "{{ url($url_admin.'/policy') }}/"+ id +"/edit",
      id: 'responsive',
			dlgClass: 'fade',
			bgClass: 'warning',
			title: 'Ubah',
			width: 'whatever',
			modal: {
				keyboard: true,
				// any other options from the regular $().modal call (see Bootstrap docs)
				},
          ajax: {
				dataType: 'html',
				method: 'GET',
				success: function(data, status, xhr){
            ojisatrianiLoadingFadeOut();
				},
			},
        });
	});

	$(document).on("click",".hapus",function() {
		ojisatrianiLoadingFadeIn();
		var id = $(this).attr('policy-id');
		$.loadmodal({
			url: "{{ url($url_admin.'/policy') }}/hapus/"+ id,
      id: 'responsive',
			dlgClass: 'fade',
			bgClass: 'danger',
			title: 'Hapus',
			width: 'whatever',
			modal: {
				keyboard: true,
				// any other options from the regular $().modal call (see Bootstrap docs)
				//$('#uraian').val(id),
				},
          ajax: {
				dataType: 'html',
				method: 'GET',
				success: function(data, status, xhr){
            ojisatrianiLoadingFadeOut();
				},
			},
        });
	});

	<!-- $(document).on("click","#policy-id",function() {
		console.log('test');

		$('#accordion-div').html('Loading ');

		var url = "{{ url($url_admin.'/search/dataOnly/') }}";
		var token = $('#_token').val();

		$.post( url, {id: 'policytest', '_token': token}, function( data ) {
			console.log(data);
		}, "json" );

	}); -->

	$(document).ready(function(){
		$("button").click(function(){
			$("#policy-id").fadeIn();
			
		});
	});

<!-- ajax -->
		$.ajax({
			type : "GET",
			data : "",
			url :  "{{ url($url_admin.'/search') }}",
			success: function(data, status, xhr) {

			}
		})

<!-- Test Button -->
 $(.policy).on('click', function() {
	 console.log('testes');
 })
    });


});