⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Please make changes in GC if i am not wrong



Paul Savostin
  • profile picture
  • Member

Posted 01 September 2015 - 19:05 PM

I found that insert_error message not working in insert state in GC datatables theme! How we see at hte attached file in update all OK!

https://github.com/scoumbourdis/grocery-crud/blob/master/assets/grocery_crud/themes/datatables/js/datatables-edit.js

 

row 62

success: function(data){
				$("#FormLoading").hide();
				if(data.success)
				{
					$('#crudForm').ajaxSubmit({
						dataType: 'text',
						cache: false,
						beforeSend: function(){
							$("#FormLoading").show();
						},
						success: function(result){
							$("#FormLoading").fadeOut("slow");
							data = $.parseJSON( result );
							if(data.success)
							{
								if(save_and_close)
								{
									if ($('#save-and-go-back-button').closest('.ui-dialog').length === 0) {
										window.location = data.success_list_url;
									} else {
										$(".ui-dialog-content").dialog("close");
										success_message(data.success_message);
										reload_datagrid();
									}

									return true;
								}

								$('.field_error').removeClass('field_error');

								form_success_message(data.success_message);
								reload_datagrid();
							}
							else
							{
								form_error_message(message_update_error);
							}
						},
						error: function(){

                                  //here we have message_update_error
							form_error_message( message_update_error );
						}
					});


Paul Savostin
  • profile picture
  • Member

Posted 01 September 2015 - 19:11 PM

but in insert

 

https://github.com/scoumbourdis/grocery-crud/blob/master/assets/grocery_crud/themes/datatables/js/datatables-add.js

 

row 70

success: function(data){
					$("#FormLoading").hide();
					if(data.success)
					{
						$('#crudForm').ajaxSubmit({
							dataType: 'text',
							cache: 'false',
							beforeSend: function(){
								$("#FormLoading").show();
							},
							success: function(result){
								$("#FormLoading").fadeOut("slow");
								data = $.parseJSON( result );
								if(data.success)
								{
									if(save_and_close)
									{
										if ($('#save-and-go-back-button').closest('.ui-dialog').length === 0) {
											window.location = data.success_list_url;
										} else {
											$(".ui-dialog-content").dialog("close");
											success_message(data.success_message);
											reload_datagrid();
										}

										return true;
									}

									$('.field_error').removeClass('field_error');

									form_success_message(data.success_message);
									reload_datagrid();

									clearForm();
								}
								else
								{
                                                    //here must be message_insert_error 
									form_error_message('An error has been occured at the insert.');
								}
							}
						});

Amit Shah
  • profile picture
  • Member

Posted 02 September 2015 - 06:32 AM

Hail Paul!!!

good thing i never got inclined towards using datatables due to its non ajax nature :)


Paul Savostin
  • profile picture
  • Member

Posted 02 September 2015 - 10:08 AM

Hi Amit!!! Why its non ajax nature? U mean that all loading at once and then using just javascript? :)  But that theme is beautiful! If change implementation for ajax using... just dreaming... -_-

By the way from my previous post with callback_insert I fount pull request on GitHub :D 

 

https://github.com/bramsi/grocery-crud/commit/c365aa1f21896ca32d73cf6cb5f17a43fb027643


Amit Shah
  • profile picture
  • Member

Posted 02 September 2015 - 12:38 PM

Yes - that was the major reason as it will kill my browser with the tons of data .. where there are 1000's of records to be loaded. 

Yes i agree .. look and feel wise - functionality wise - its good.. or say much better then flexigrid... 

 

To ajaxify the process - there are options open but 1 needs to apply them to achieve the desired results. All the best.. i am happy with my modified flexigrid or may now move on to bootstrap :D

 

Thats nice