$('.select2-cityeditbill').select2({
   ajax: {
          url: url_getcity,
          type: "get",
          dataType: 'json',
          delay: 100,
          data: function (params) {
             return {
                searchTerm: params.term // search term
             };
          },
          processResults: function (response) {
             return {
                results: response
             };		   
         },
          cache: true
        }
   });
     
   $('.select2-cityeditbill').on('select2:select', function (e) {
        var city = e.params.data.id;
        console.log("here");
        $.ajax(url_getstatefromcity,{
           type : 'get',
           data :{'city' : city} ,
           success : function(data){
              
              
              $(document).find('#Stateedit').val(data.state.state_title);
              $(document).find('#Stateedit').attr("data-state-id",data.district.state_id);
              $(document).find('#Statesedit').attr("data-state-id",data.district.state_id);
              
              $(document).find('#Countryedit').val("India");
              
           },
           error: function (jqXhr, textStatus, errorMessage) {
              console.log('Error' + errorMessage);
      }
        });
  });
  
  
    
  $('.select2-cityeditship').select2({
     ajax: {
            url: url_getcity,
            type: "get",
            dataType: 'json',
            delay: 100,
            data: function (params) {
               return {
                  searchTerm: params.term // search term
               };
            },
            processResults: function (response) {
               return {
                  results: response
               };		   
           },
            cache: true
          }
     });
     
     $('.select2-cityeditship').on('select2:select', function (e) {
          var city = e.params.data.id;
          console.log("here");
          $.ajax(url_getstatefromcity,{
             type : 'get',
             data :{'city' : city} ,
             success : function(data){
                
                
                $(document).find('#ShipToStateedit').val(data.state.state_title);
                $(document).find('#ShipToStateedit').attr("data-state-id",data.district.state_id);
                
                $(document).find('#ShipToCountryedit').val("India");
                
             },
             error: function (jqXhr, textStatus, errorMessage) {
                console.log('Error' + errorMessage);
        }
          });
    });
    
    
     