我有带有ID的数组,并希望通过id删除它们
$membersId = array('1','2','3');
$inStatement = implode(',', $membersId);
//dont work!
TRatingMembers::model()->deleteAll(array('member_id IN (:member_id)'),
array(':member_id' => $inStatement));
Run Code Online (Sandbox Code Playgroud)
如何用一个事务删除所有行?
我有一个像这样的选项对话框:
String[] options = ["Yes", "No"]; //button names
int n = JOptionPane.showOptionDialog(singleFrameService.getFrame(),
"Some Question?",
"",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null, //do not use a custom Icon
options, //the titles of buttons
options[0]); //default button title
//if press yes
if (n == JOptionPane.YES_OPTION){
//make some if pressed Yes
}
Run Code Online (Sandbox Code Playgroud)
当我使用鼠标并按是/否 - 一切正常...但是当我开始使用键盘时,按TAB转到"否"按钮,然后按ENTER键 - 工作"是"选项
我有这样的代码
$(document).ready(function(){
$(".add").bind ('click',
function ()
{
$('.main').append('<div class="add">Add element 2</div>');
});
});
</script>
<div class="main"><div class="add">Add element</div></div>
Run Code Online (Sandbox Code Playgroud)
当虚拟对象".add"附加到".main"时,jquery不会对它们进行单击作出反应
我有一个扩展ListActivity的类,它的工作正常
然后在onListItemClick()中我使用getSelectedItemPosition()并且它总是返回-1
PS getSelectedItemId()返回一些长号,如994393434
public class TasksShowActivity extends ListActivity {
private Cursor mCursor;
private ListAdapter mAdapter;
private static final String[] mContent = new String[] {
TasksDbHelper._ID, TasksDbHelper.NAME,
TasksDbHelper.USER};
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mCursor = managedQuery(
TasksProvider.CONTENT_URI, mContent, null, null, null);
mAdapter = new SimpleCursorAdapter(this,
R.layout.tasks, mCursor,
new String[] {TasksDbHelper.NAME, TasksDbHelper.USER},
new int[] {R.id.name, R.id.date});
setListAdapter(mAdapter);
}
@Override
protected void onListItemClick(ListView l, View v, int position, final long id) {
super.onListItemClick(l, v, position, id);
Toast toast = Toast.makeText(this, "Position: …Run Code Online (Sandbox Code Playgroud)