Coder Social home page Coder Social logo

combogrid's Introduction

comboGrid For datatables

参考了:datatimepicker.js 使用方法:

/****主表单元格单击****/
    $('#jjg-table > tbody ').on('click','td',function (e) {
      var tr = $(this).closest('tr');
      var row = jjgtable.row( tr );
      var data = row.data();//当前行数据
      var colindex = $(e.target).index();
      var rowindex = row.index();
      var celldata=$(this).text();
      if (colindex==3){
        var put=$('<input type="text" style="width:100%;" value="'+celldata+'"/>');
        $(e.target).html(put);
        $("input[type=text]").comboGrid({
          maintable:jjgtable,
          maintablecols:['wqgj','wqgjj','wqgdql','nqgjj','nqgdql','gqs','gqzj','jcj'],
          curtablecols:['wqgj','wqgjj','wqgdql','nqgjj','nqgdql','gqs','gqzj','jcj'],
          maintablerowindex:rowindex,
          tableid:'wqljh'+data.xh,
          url:'micros/core/dbop.php/?load=yxjcj*',
          serverSide:true,
          columns:[
            {"bSortable": false,"class":'center',"data":"xhgg","name":"xhgg","title":"型号规格"}
          ],
          aLengthMenu: [[-1], ["全部"]],
          scrollY: 208,//同时开启垂直(表格高度)和水平滚动条
          scrollX: "100%",
          sScrollXInner: "100%",
          scrollCollapse:true,
          dom:'t'
        }).focus();//输入框获得焦点

      }
      $(e.target).on('blur','input',function () {//输入框失去焦点时
        var txt=$(e.target).children("input").val();
        $(e.target).html(txt);
        jjgtable.cell($(e.target)).data(txt);//修改DataTables对象的数据

      });
      //return false;//停止函数执行-***重要,否则会
    });

combogrid's People

Contributors

michaellions avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.