Jump to content


[ANSWERED] set_relation and "Add New" button to quick insert.


  • Please log in to reply
24 replies to this topic

#21 Fmasterous

Fmasterous

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 14 January 2015 - 12:40 PM

Question: Is there any way to update the dropdown immediatedly after inserting the new data ? Because I need to reload the browser to get the dropdown updated..



#22 Fmasterous

Fmasterous

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 14 January 2015 - 12:59 PM

Question: Is there any way to update the dropdown immediatedly after inserting the new data ? Because I need to reload the browser to get the dropdown updated..

 

Thanks for the nice idea. I have one problem. I want the value entered in the New Window to come to the input box of 1st window whenever the submit button of New window is clicked.
How can I do this thing? Please advice

Did you manage to do that ? I want my program to do the same thing...



#23 Fmasterous

Fmasterous

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 13 March 2015 - 02:30 PM

Hello guys,

 

First of all, thank you for this nice framework..

 

I've been following this thread and managed to add the fancybox button, but I want it to be only inside the "add/edit" pages, and I want to hide it on the "read" pages...

 

Is there any way to do it without ruining the other functionalities on the "add/edit" pages..

 

Thank you in advance



#24 ljegou

ljegou

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 24 August 2015 - 01:48 PM

Hello, just an addendum to this thread to thanks the authors and to point a bug : at the end of the quick_add_save() function in the controller, one should echo the new id value instead of returning it :

			$this->db->insert('country', $data);
			$newid = (string)$this->db->insert_id();
			echo $newid;


#25 rodrigoselau

rodrigoselau

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 30 September 2016 - 02:28 PM

I am having difficulty in this code, it sends the information to the "quick_add_ssid_save", only it is not added to the information in the database, the following code:

function quick_add_ssid()
	{

		$javascript = '
			<script>
			function do_quick_ssid_add()
			{
			var ssid_text = $(\'#ssid_nome\').val();
			var ssid_crip = $(\'#ssid_crip\').val();

			$.post(\''.site_url().'/admin/ptp1610/index/quick_add_ssid_save/\', { ssid_nome: ssid_text, ssid_crip: ssid_crip }, function(data) {
				$(\'#ssid_message\').html(\'Successfully inserted a new category\');
			});
			}
			</script>
			';

		$html = '
			<div style="width: 400px; height: 250px;">
			<div style="padding: 5px;">Novo SSID:</div>
			<div style="padding: 5px;"><input type="text" name="ssid_nome" id="ssid_nome"></div>
			<div style="padding: 5px;">Nova Criptografia:</div>
			<div style="padding: 5px;"><input type="text" name="ssid_crip" id="ssid_crip"></div>
			<div style="padding: 5px;"><input type="button" value="Add &raquo;" onclick="do_quick_ssid_add();"> <span id="ssid_message"></span></div>
			</div>
			';

		echo $javascript.$html;
		exit;
	}

		function quick_add_ssid_save()
		{
			//POST ITEMS //only needed if adding a sub category, can get parent ID
			$ssid_nome = $this->input->post('ssid_nome', true);
			$ssid_crip = $this->input->post('ssid_crip', true);
			$data = array(
        		'idSsid_crip' => NULL,
        		'ssid' => 'ssid_nome',
        		'crip' => 'ssid_crip'
			);

			$this->db->insert('csm_Ssid_crip', $data);
	}

Thank you very much in advance

:D






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users