Home Backend Development PHP Tutorial Difficulties and miscellaneous diseases of ThinkPHP (5)

Difficulties and miscellaneous diseases of ThinkPHP (5)

Jul 28, 2016 am 08:27 AM
addclass append option

<code>细节问题总是很多,想要更加优良的客户体验,必须吹毛求疵吧!
</code>
Copy after login

I encountered a small problem. How to realize that the initialized value of the select drop-down menu button is only displayed when it is loaded for the first time, and then it is still displayed in the drop-down menu but is not selectable?
 ThinkPHP之疑难杂症(五)

The effect here is selectable, if you want it it cannot be selected.
 ThinkPHP之疑难杂症(五)
Speaking of the function that cannot be selected, I need to add a disabled attribute to the <option> tag. However, after adding it directly, I found that the initialized default value cannot be displayed. This is not what I want, so I don’t know what to do. I was shocked...

My friend said it could be implemented using js, but he didn't know how to break it, and no one could help. So someone came up with the idea of ​​nesting an if statement, but not adding this attribute the first time, so——
 ThinkPHP之疑难杂症(五)
That's OK...

Then, comes the second functional question, how to implement fuzzy retrieval of menu names?

This is really stumping me... (It seems that every problem stumps me, and I ask netizens to solve it)

The initial idea is to add a search condition based on the original search function.
 ThinkPHP之疑难杂症(五)
Just add it at this location.

However, since I initially thought that the menu name I wanted to fuzzy search was a field name, the search could not be achieved using the syntax '%'.like.'%'. Then I thought about extracting the menu name into a parent table to implement the search function, but This shows my confusion, because the Menu table retrieved here is equivalent to a parent table, a menu management table, and the menu name here is the table content... And my mistake turned out to be...
 ThinkPHP之疑难杂症(五)
I wrote the wrong field name in the code related to this function from the front end to the backend. I wrote it as title. I thought it was right (not a mistake), and then I changed it to name and it was OK! ! !

Front-end code implementation
 ThinkPHP之疑难杂症(五)

Back-end code implementation
 ThinkPHP之疑难杂症(五)

The occurrence of this problem shows a very serious problem. If a developer is not familiar with the database, he will have a headache and all kinds of weird problems. People are exhausted -_-#

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the difficult and miscellaneous diseases of ThinkPHP (5), including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What does option mean in linux documentation? What does option mean in linux documentation? Mar 07, 2023 am 10:41 AM

In Linux, option refers to a command option, which is a switch that adjusts the command execution behavior. That is, different options determine the display results of the command. Options are divided into long options and short options: 1. Short options are guided by "-". When there are multiple short options, spaces are used to separate each option; 2. Long options are complete words. , and usually cannot be combined.

Use java's StringBuilder.append() function to splice strings Use java's StringBuilder.append() function to splice strings Jul 26, 2023 am 09:18 AM

Use Java's StringBuilder.append() function to splice strings. In Java programming, string splicing is a very common operation. In order to efficiently splice strings, Java provides the StringBuilder class, whose append() function can quickly join multiple strings together. StringBuilder is a variable character sequence that is more efficient to use than the String class. When we need to concatenate a large number of strings, use

Summary of commonly used file operation functions in PHP Summary of commonly used file operation functions in PHP Apr 03, 2024 pm 02:52 PM

目录1:basename()2:copy()3:dirname()4:disk_free_space()5:disk_total_space()6:file_exists()7:file_get_contents()8:file_put_contents()9:filesize()10:filetype()11:glob()12:is_dir()13:is_writable()14:mkdir()15:move_uploaded_file()16:parse_ini_file()17:

How to use append in python How to use append in python Nov 14, 2023 am 10:41 AM

In Python, append() is a method of the list object that is used to add an element to the end of the list. It should be noted that the append() method can only be used for list objects and cannot be used for other types of objects. In addition, the append() method will directly modify the original list without returning a new list.

How to use append How to use append Oct 25, 2023 pm 03:14 PM

append is a commonly used command line tool used to append the contents of one file to the end of another file. The usage of the append command is "append [option] source file target file", where the source file is the file to be appended and the target file is the file to be appended.

How to use the append() method of the StringBuilder class to splice strings in Java How to use the append() method of the StringBuilder class to splice strings in Java Jul 25, 2023 pm 03:05 PM

How to use the append() method of the StringBuilder class to splice strings in Java. Splicing strings is a common operation in Java. During the splicing process, if the basic String class is used for string addition, new String objects will be created frequently, thus affecting performance. In order to solve this problem, Java provides the StringBuilder class to perform string splicing operations. StringBuilder class is one of the Java

How to add a class in jQuery? How to add a class in jQuery? Apr 03, 2024 am 09:01 AM

This article will explain in detail how to add classes in Jquery? , the editor thinks it is quite practical, so I share it with everyone as a reference. I hope everyone can gain something after reading this article. Two common methods for adding classes in jQuery 1. addClass() method The addClass() method adds one or more classes to the selected element. The syntax is as follows: $(selector).addClass(classNames); where: selector: the element selector to add the class. classNames: Classes to add, can be a single string or a space-separated list of strings. For example, the following code adds ac to the element with the ID my-element

SMS API interface calling example based on aggregated data-Python version SMS API interface calling example based on aggregated data-Python version Apr 03, 2024 pm 01:28 PM

1. Apply for the interface through https://www.juhe.cn/docs/api/id/54. Self-service application to open the SMS API and obtain the interface request key. (Currently, the interface only supports enterprise users.) After applying, submit a text message template in the personal center. The official aggregation has provided a number of commonly used templates, which can be quickly applied for. 2. For the official interface document of python code example, please refer to: Https://www.juhe.cn/docs/api/id/54#!/usr/bin/Python#-*-coding:utf-8-*-importurllib, urllib2,sys,JSONreload(

See all articles