码迷,mamicode.com
首页 > 其他好文 > 详细

day94 10.14

时间:2017-10-14 12:46:17      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:getch   语言   open   opened   close   hid   on()   float   return   

技术分享
s5day94
内容回顾:
    1. 字符串格式化
          正则: /xx/g
        js原型:为类定制方法
       replace:字符串替换
       
    2. display
    
    3. choice选项:
        模板语言:get_xx_display()   yield
             js : @@
        
今日内容:增删改查插件
    1. 定制属性
        @
        setAttribute
        attr()
        
    2. 分页
        page_html_js
        
    3. 组合搜索
        - 后台配置项
        - position
        - 
            <div class=clearfix>
                <div float></div>
                ...
            </div>
            
            :after
        - click和on
        - append,appendTo
        - 
            var a;
            a = {name:alex}
            a.xx, undefined
        - ajax:
            # 1. 成功,value=字符串、数字
            $.ajax({
                data:{name:alex,age:18}
            })

            # 2. 成功,value=字符串、数字、列表
            $.ajax({
                url:‘‘,
                type:‘‘,
                data:{name:alex,age:18,hobby:[11,22,33]},
                traditional:true,
                success:function(){
                }
            })



            # 3. 成功,value=字符串、数字、列表; 序列化字符串
            $.ajax({
                url:‘‘,
                type:‘‘,
                data:{name:alex,age:18,hobby:[11,22,33],test:JSON.stringfy({k1:v1})},
                traditional:true,
                success:function(){
                }
            })

        - Q
            语法:
                Q(id=1)|Q(id=1)
            
            对象:
                con = Q()
                temp = Q()
                temp.connector = OR
                temp.children.append((id, 1,))
                temp.children.append((id, 1,))
                temp.children.append((id, 1,))
                con.add(temp, AND)
        
        
    4. 编辑模式:
         进入:文本变更为input或select
         退出:input或select变更为文本
         
本周作业:
    1. 目前功能
        - 先看
        - 自己写
    2. 随便搞一个表格【input,select】
            
            choices = [
                [1,xxx],
            ]
    
            进入:文本变更为input或select
            退出:input或select变更为文本
大纲

 

 
技术分享
    var GLOBAL_CHOICES_DICT = {
        //定义全局状态字典
        // status_choices: [[0,xxx],]  状态及对应项
        // xxxx_choices: [[0,xxx],]
    };

    function getChoiceNameById(choice_name, id) {    // 定义通过id获取对应中文名的函数 choice_name类似于‘status_choices’
        var val;

        var status_choices_list = GLOBAL_CHOICES_DICT[choice_name];  //获取到状态的对应项列表 [[0,xxx],]
        $.each(status_choices_list, function (kkkk, vvvv) {   //遍历列表
            if (id == vvvv[0]) {      //如果id对应 取到对应中文名并返回
                val = vvvv[1];
            }
        });
        return val;
    }
获取中文名称 nblist.js

 

day94 10.14

标签:getch   语言   open   opened   close   hid   on()   float   return   

原文地址:http://www.cnblogs.com/hsddon/p/7665649.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!