Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop
    1. Home
    2. oditha
    3. Posts
    • Profile
    • Following 0
    • Followers 2
    • Topics 16
    • Posts 75
    • Best 15
    • Controversial 0
    • Groups 1

    Posts made by oditha

    • RE: Vue JS Update data after db records update

      @root elakiri. man try karala balannam

      posted in Front-End Development
      oditha
      oditha
    • RE: Vue JS Update data after db records update

      @root hariyatama therune naha machan

      posted in Front-End Development
      oditha
      oditha
    • RE: Vue JS Update data after db records update

      @root Danui eka dakke :confused:

      Before Update
      Screenshot_2020-01-15 CoreUI - Vue Open Source Bootstrap Admin Template.png

      After Table update or insert new

      Screenshot_2020-01-15 CoreUI - Vue Open Source Bootstrap Admin Template(1).png

      posted in Front-End Development
      oditha
      oditha
    • RE: Vue JS Update data after db records update

      @root 01 - https://ibb.co/BnvwwTX
      02 - https://ibb.co/kBxyffJ

      posted in Front-End Development
      oditha
      oditha
    • RE: Lanka developers t-shirt

      Karamu wade

      posted in Comments & Feedback
      oditha
      oditha
    • RE: Vue JS Update data after db records update

      @root Wade hari. eth dan thwa issue ekk enawa. data refresh wenakota pagination eka awul wenwa.

      Before Update
      01

      After Data Refresh
      02

      posted in Front-End Development
      oditha
      oditha
    • Vue JS Update data after db records update

      Vue Project ekka db recode ekak update karagen passe update una data show karaganne kohomeda?

      Danata thiyea code eka

      <template>
        <div class="col-md-12">
          <div class="card">
            <div class="card-header">
              All Users
      
              <button class="btn btn-primary px-4 float-right mt-0 mb-3" @click="showModal = true">Add Author</button>
      
            </div>
            <div class="card-body">
      
              <table class="table table-striped">
                <thead>
                  <tr>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Actions</th>
                  </tr>
                </thead>
                <tbody>
                  <tr v-for="author in displayedAuthors" :key="author._id">
                    <td>{{ author.name }}</td>
                    <td>{{ author.email }}</td>
                    <td>
                      
                      <button @click="editAuthor(author)" class="btn btn-primary btn-sm mr-2"><i class="cil-energy"></i>Edit</button>
                      <router-link :to="{name: 'edit', params: { id: author._id }}" class="btn btn-danger btn-sm"><i class="cil-energy"></i>Delete</router-link>
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
      
            <div class="card-footer">
              <nav aria-label="Page navigation example">
                <ul class="pagination">
                  <li class="page-item">
      					    <button type="button" class="page-link" v-if="page != 1" @click="page--"> Previous </button>
      				    </li>
                  
                  <li class="page-item" v-for="pageNumber in pages.slice(page-1, page+5)" v-bind:key="pageNumber"><a class="page-link" @click="page = pageNumber">{{pageNumber}}</a></li>
                  
                  
                  <li class="page-item">
      					    <button type="button" @click="page++" v-if="page < pages.length" class="page-link"> Next </button>
      				    </li>
                </ul>
              </nav>
            </div>
          </div>
          <form @submit.prevent="addAuthor">
            <CModal title="Modal title" :show.sync="showModal" color="primary">
      
              <div class="form-group">
                <label for="exampleInputEmail1">Full Name</label>
                <input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
                  v-model="author.name">
      
              </div>
              <div class="form-group">
                <label for="exampleInputEmail1">Email address</label>
                <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
                  v-model="author.email">
      
              </div>
      
              <template #header>
                <h6 class="modal-title">Create Authors</h6>
                <CButtonClose @click="showModal = false" class="text-white" />
              </template>
              <template #footer>
                <CButton @click="showModal = false" color="danger">Close</CButton>
                <CButton color="primary" type="submit">Save</CButton>
              </template>
            </CModal>
          </form>
      
          <!--* Update Modal -->
          <form @submit.prevent="updateAuthor">
            <CModal title="Edit Author" :show.sync="editModal" color="success">
      
              <div class="form-group">
                <label for="exampleInputEmail1">Full Name</label>
                <input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
                  v-model="author.name">
                <input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
                  v-model="author._id">
      
              </div>
              <div class="form-group">
                <label for="exampleInputEmail1">Email address</label>
                <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
                  v-model="author.email">
      
              </div>
      
              <template #header>
                <h6 class="modal-title">Edit Authors</h6>
                <CButtonClose @click="editModal = false" class="text-white" />
              </template>
              <template #footer>
                <CButton @click="editModal = false" color="danger">Close</CButton>
                <CButton color="success" type="submit">Update</CButton>
              </template>
            </CModal>
          </form>
        </div>
      </template>
      
      <script>
        export default {
          data() {
            return {
              showModal: false,
              editModal: false,
              authors: [],
              author: {},
              page: 1,
              perPage: 9,
              pages: [],
            }
          },
          computed: {
            displayedAuthors() {
              return this.paginate(this.authors);
            }
          },
          watch: {
            authors() {
              this.setPages();
            }
          },
          created() {
            this.getAuthors()
          },
          filters: {
            trimWords(value) {
              return value.split(" ").splice(0, 20).join(" ") + '...';
            }
          },
          methods: {
            addAuthor() {
              let uri = 'http://localhost:4000/authors/add';
              this.axios.post(uri, this.author).then((response) => {
      
                console.log(response.data)
                this.showModal = false
                this.author.name = ''
                this.author.email = ''
                this.authors.push(response.data)
              });
            },
            getAuthors() {
              let uri = 'http://localhost:4000/authors';
              this.axios.get(uri).then(response => {
                this.authors = response.data;
              });
            },
            editAuthor(author){
              this.author.name = author.name;
              this.author.email = author.email;
              this.author._id = author._id;
              this.editModal = true
      
            },
            updateAuthor(){
              console.log(this.authors)
              let uri = `http://localhost:4000/authors/update/${this.author._id}`;
                this.axios.post(uri, this.author).then(() => {
                  this.editModal = false
                  
                  // UPDATE TABLE HERE 
      
                });
            },
            setPages() {
              let numberOfPages = Math.ceil(this.authors.length / this.perPage);
              for (let index = 1; index <= numberOfPages; index++) {
                this.pages.push(index);
              }
            },
            paginate(authors) {
              let page = this.page;
              let perPage = this.perPage;
              let from = (page * perPage) - perPage;
              let to = (page * perPage);
              return authors.slice(from, to);
            }
          }
        }
      </script>
      
      
      posted in Front-End Development
      oditha
      oditha
    • RE: VUE CLI එකම ඇප් එකේ frontend & backend

      @root Thanks bro

      posted in Front-End Development
      oditha
      oditha
    • VUE CLI එකම ඇප් එකේ frontend & backend

      VUE ඇප් එකක client end & admin end එකක් හදන්න ඕන. එතකොට client end එකට එක template එකකුත් admin end එකට වෙන එකකුත් පාවිච්චි කරනන පුලුවන්ද? ඒක කරන්නේ කොහොමද ?

      posted in Front-End Development
      oditha
      oditha
    • RE: laravel සම්බන්දයෙන් මේක හදාගන්න විදියක්

      .env file eke db eke details check karala balanna

      DB_CONNECTION=mysql
      DB_HOST=[your db host ]
      DB_PORT=[your db port]
      DB_DATABASE=[your db name]
      DB_USERNAME=[your db username]
      DB_PASSWORD=[your db passowrd]

      EX:-

      DB_CONNECTION=mysql
      DB_HOST=127.0.0.1
      DB_PORT=3306
      DB_DATABASE=hyspecs
      DB_USERNAME=GrAPEry
      DB_PASSWORD=A2k%x8Ybcloob5Zb

      posted in Back-End Development
      oditha
      oditha
    • RE: Google Cloud / AWS කියලා දෙන්න කැමති ඔයලා කැමතිනම්

      Patanganna bro wade..

      posted in Cloud Computing
      oditha
      oditha
    • RE: Vue JS or Laravel Blade??

      @root Thanks Brother

      posted in Front-End Development
      oditha
      oditha
    • Vue JS or Laravel Blade??

      web application ekaka customerge front end eka laravel blade or Vue JS walin karoth da SEO walata pahasu wenne?

      posted in Front-End Development
      oditha
      oditha
    • RE: Now you can code with Express.JS in Sinhala

      superb bro

      posted in Programming
      oditha
      oditha
    • RE: Final year project ideas for software engineering students

      How about the social platform for share shopping experience and offers?

      posted in General Discussion
      oditha
      oditha
    • RE: Reload, Bill Payments WEB API

      @root elakiri bro. Man try karannam

      posted in General Discussion
      oditha
      oditha
    • Reload, Bill Payments WEB API

      Reloads, Mobile Bills Payments & Utility Bill payment walata use karanna puluwan web API eka tiyenwada lankawe?

      posted in General Discussion
      oditha
      oditha
    • RE: Laravel URL Rewrite !HELP!

      Wade hari. Thanks for the everyone.

      posted in General Discussion
      oditha
      oditha
    • RE: Laravel URL Rewrite !HELP!

      @root

      RewriteEngine On
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
      
      posted in General Discussion
      oditha
      oditha
    • RE: Laravel URL Rewrite !HELP!

      @root Rewrite rule eka thama galapa ganna bariwa inne

      posted in General Discussion
      oditha
      oditha
    • 1
    • 2
    • 3
    • 4
    • 3 / 4