Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- $( "#supcode" ).autocomplete({
- source:"index.php/inventory/supcode",
- minLength: 1
- });
- });
- function supcode()
- {
- $dataarray="";
- $data=$this->Inventorymodel->supcode();
- echo json_encode($data);
- }
- function supcode(){
- $finresult="";
- $this->db->select('name');
- $query = $this->db->get('supplier');
- $result=$query->result_array();
- foreach($result as $row){
- $finresult[]=array(
- 'name' => $row['name']
- );
- }
- return $finresult;
- }
- [ { label: "Choice1", value: "value1" }, ... ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement