Announcement

Collapse
No announcement yet.

Populating the field with columns in the database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Populating the field with columns in the database

    There are cities in the database table. How can I fill in an entity field with it?

  • #2
    I think the best way in this case is to create an entity City, and use it as a link to entity

    Comment


    • #3
      I have one more question. I will do the same in the towns. But how do I relate the city and the town? Because there are the same ID's in the towns.
      Last edited by gundogduyakici; 03-21-2018, 12:33 PM.

      Comment


      • #4
        use this id as additional field, not basic ID. Like SIC code in Account.

        Comment


        • #5
          I did. But, for example, if I choose a city, I can not show the towns connected to it automatically.. tanya

          Comment


          • #6
            Open Opportunity. If you select account, you can choose related contacts only.
            or check tree views (Knowledge Base or Reports Categories), if tree view is good for you

            Which way is better for you?

            Comment


            • #7
              like Tree view. tanya

              Comment


              • #8
                But I want to do these as areas within the customers. Because they are the city and the town of the client. It has to be like Select. tanya
                Attached Files

                Comment


                • #9
                  ?
                  for this better and easier to develop it like contacts in Opportunity. Why tree view if the depth is up to 2

                  Comment


                  • #10
                    I'm sorry I told him wrong. Did I tell you what I mean? tanya

                    Comment


                    • #11
                      function changeTowns(a) {
                      var select = $('select[name="town_id"]');
                      select.html("");
                      if ($(a).val() == "") {
                      select.append('<option value="">Lütfen Seçiniz</option>');
                      }
                      $.ajax({
                      type: 'GET',
                      url: '<?php echo base_url('admin/ajax/getTowns/');?>' + $(a).val(),
                      dataType: 'json',
                      beforeSend: function () {
                      $('.loadingCity').removeClass("hidden"),
                      $('.citySelect').addClass("hidden")
                      },
                      success: function (data) {
                      if (data.status == 404) {
                      alert(data.msg);
                      } else {
                      $('.loadingCity').addClass("hidden");
                      $('.citySelect').removeClass("hidden");
                      select.append('<option value="">Lütfen Seçiniz</option>');
                      $.each(data, function (index, element) {
                      select.append('<option value="' + element.id + '">' + element.name + '</option>');
                      })
                      }
                      }
                      });
                      }

                      Comment

                      Working...
                      X